greasemonkey-4

How do I take text contained in web page and make it part of the page title?

♀尐吖头ヾ 提交于 2021-01-28 12:23:16
问题 I desperately need help with writing a Tampermonkey/Greasemonkey script that takes part of the information within the web page and makes it part of the page (and window) title. A client's name is part of the target (internal) web page, and clearly labeled within the HTML: <div id="patient-info" class="ehr-patients-info"> <div id="patient-identification"> <span title="" id="patient-name"> Johnnyfirst Smithylast </span> </div> ... I want to add the text "Johnnyfirst Smithylast" to the window

Is there a way to find where the code creates the dynamically popup on browsers?

无人久伴 提交于 2020-06-29 04:26:13
问题 When I open a website that's not developed by me, it created a pop up of a DIV element. How can I find which code create that popup? I tried to set the breakpoint, but it only show the popup in the first time. Please note the key here are It's a website that's not developed by me The Popup is a DiV The popup only show the first time. If I refresh the page, it's gone. I'm not asking you to debug the site for me, I want to learn the ways to debug it by myself. What I'm after is programmatically

Firefox doesn't respect Object.defineProperty() from a Greasemonkey script?

牧云@^-^@ 提交于 2020-01-03 05:35:29
问题 I'm writing a userscript to prevent a website to set document.body.innerHTML , this is a typical sign of a website detecting adblock: (function() { 'use strict'; console.log("Loading ..."); Object.defineProperty(document.body, "innerHTML", { set: function() { console.log("malicious activity detected"); throw "Don't try to fool my adblock!"; } }); console.log("Test setting document.body ..."); try { document.body.innerHTML = ""; } catch (e) { console.log(e); } }) (); The above userscript works

How do I fix an infinite loop in a hacked version of waitForKeyElements?

依然范特西╮ 提交于 2019-12-25 03:10:52
问题 My company's website uses the Metronic Horizontal Menu admin panel, but it's an older version that uses a Gear instead of the user profile picture and name. Before Firefox 30, this Greasemonkey script was working and would move the "My Profile" and "Log Out" buttons under the user profile/name, while keeping "My Calendar", "My Inbox", and "My Tasks" inside the gear icon dropdown. Here's my Greasemonkey code: // ==UserScript== // @name Fix User Dropdown // @description Fixes the user dropdown

How to Transfer All Greasemonkey userscripts to Tampermonkey on Firefox 57+

霸气de小男生 提交于 2019-12-18 02:51:15
问题 After read that Greasemonkey recommends users to install Tampermonkey or Violentmonkey. I've installed Tampermonkey and now I'm trying to transfer all my Greasemonkey 3.x scripts to be opened on Tampermonkey, but I can't find it's location or even how to do it. I've read this question that says where and how it's located on Chrome, but where is it on Firefox 57+? How can I transfer it? PS: I'm expecting I won't need to update every userscript I have. 回答1: Based on derjanb comment I'm

How to use Greasemonkey to selectively remove content from a website?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 09:24:16
问题 I have tried removing content (paid content) from this website with uBlock origin , Greasemonkey and Anti-Adblock Killer script. I have tried running this script but without success. The ("paid") content I want to remove looks like this: <div class="news" info="398825"> <div class="normal" ...> <div class="supertitle"> <a href="http://www.monitor.hr/marketing/sponzorirana.html" target="_blank">Sponzorirana vijest</a> </div> ... I can differentiate "paid content" from rest of the content with

Greasemonkey: “GM_xmlhttpRequest is not defined” with the new update

心已入冬 提交于 2019-12-08 08:15:08
问题 Why this simple Greasemonkey script is not working for me https://jsfiddle.net/pghnsw8z/1/ ? I mean that instead of getting successful response I get error while making an ajax call. // ==UserScript== // @name _Starter AJAX request in GM, TM, etc. // @match *://php.net/* // @grant GM_xmlhttpRequest // @connect php.net // ==/UserScript== GM_xmlhttpRequest ( { method: 'GET', url: 'http://php.net/', onload: function (responseDetails) { // DO ALL RESPONSE PROCESSING HERE... alert(responseDetails)

Is the Immediately-Invoked Function Expression (IIFE) pattern really necessary when writing userscripts?

只愿长相守 提交于 2019-12-07 12:43:33
问题 My question is quite similar to What is the purpose of a self executing function in javascript?, however it concerns userscripts (specifically for GreaseMonkey) instead. I see that some userscripts are distributed with this pattern, and some are not. Example of script with the IIFE pattern: (source) // ==UserScript== // (...) // ==/UserScript== (function(){ // if <condition> document.location.href += '?sk=h_chr'; // ... })(); Example of script without it: (source) // ==UserScript== // (...) /

How do you create a new script in Greasemonkey 4?

拥有回忆 提交于 2019-12-06 17:12:41
问题 Greasemonkey 4.0 has changed its interface, and for the life of me I cannot find any way to create a new script. 回答1: Update: this was fixed in version 4.1 on 11-Dec-2017 (thankfully someone opened a bug for it) It really seems like version 4.0 has no way to do this (and is very poorly documented) and so my workaround was just to install a simple/short script that seemed low risk and then just edit that script to make it my own. I used this script (source code to check for safety) and clicked

Greasemonkey: “GM_xmlhttpRequest is not defined” with the new update

橙三吉。 提交于 2019-12-06 17:04:27
Why this simple Greasemonkey script is not working for me https://jsfiddle.net/pghnsw8z/1/ ? I mean that instead of getting successful response I get error while making an ajax call. // ==UserScript== // @name _Starter AJAX request in GM, TM, etc. // @match *://php.net/* // @grant GM_xmlhttpRequest // @connect php.net // ==/UserScript== GM_xmlhttpRequest ( { method: 'GET', url: 'http://php.net/', onload: function (responseDetails) { // DO ALL RESPONSE PROCESSING HERE... alert(responseDetails); console.log ( "GM_xmlhttpRequest() response is:\n", responseDetails.responseText.substring (0, 80) +