greasemonkey

create a cookie with javascript in greasemonkey

試著忘記壹切 提交于 2019-12-10 14:22:30
问题 i'm trying to create a cookie with greasemonkey in order to stop a window from popping up (after the windows pops up a cookie is created the the window won't popup to many times... this is the code function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toUTCString()); } var cookie_names = [ 'showDrushimPopUnderUserClick',

How can I return a value from GM_xmlhttprequest?

↘锁芯ラ 提交于 2019-12-10 14:18:08
问题 I have this code here: var infiltrationResult; while(thisOption) { var trNode = document.createElement('tr'); var tdNode = document.createElement('td'); var hrefNode = document.createElement('a'); infPlanetID = thisOption.getAttribute('value'); var myURL = "http://www.hyperiums.com/servlet/Planetinf?securitylevel=90&newinfiltr=New+infiltration&planetid=" + PlanetID + "&infplanetid=" + infPlanetID; GM_xmlhttpRequest({ method: 'GET', url: myURL, headers: { 'User-agent': 'Mozilla/4.0 (compatible

How can I use GreaseMonkey to give the browser back the “/” key?

ぃ、小莉子 提交于 2019-12-10 13:12:20
问题 Lots of web pages seem to use the / key for searching. I'd like to disable that because 100% of the time I want to use / to search in the page in FireFox. Is there a way I can override this behavior with GreaseMonkey or dotjs? The best public example of this is https://www.github.com/, also https://wiki.jenkins-ci.org/display/JENKINS/Issue+Tracking 回答1: If you set addEventListener()Doc on window and use "event capture", you will catch 99% of what the page tries to do. (Not counting plugins

Greasemonkey simple html text replacing not working

那年仲夏 提交于 2019-12-10 12:04:50
问题 I need to replace all the olds links of an HTML page by the new web page so I created the following script document.body.innerHTML.replace('www.forumoldpage','www.forumnewpage'); Save it but when I open the web page do nothing. There's something wrong with the code or do I forgot something to do? 回答1: I was led to this question when trying to create my very first greasemonkey script, so I thought it's for the benefit of everybody if this question has an answer. Try this: document.body

greasemonkey insert javascript

不羁的心 提交于 2019-12-10 11:46:41
问题 I have a bookmarklet, clicking the bookmarklet includes a PHP script (evaluated as a JavaScript file) to the page few table values and select values passed as GET parameters. The PHP script writes the page data to the MySQL database, and outputs a success message that is treated as JavaScript code and executed by the browser. Is there any possibility to do this using greasemonkey and call this function when a existing button is clicked on the web page. I wrote the above bookmarklet inspired

want to auto click cancel in prompt in firefox

浪子不回头ぞ 提交于 2019-12-10 11:35:54
问题 OK so i currently play a game that has a random "bot-check" pop up in the tab in the pop up it has a "OK" and "cancel" button and I'm trying to find or make a grease monkey script to auto click "cancel" when it pop's up and since its random it needs to be a always on type script the prompt always shows up in the same x and y co-ordinates and button 1 is always OK and button 2 is always cancel hitting escape works just the same as hitting cancel ive tried google and i cant find anything 回答1: /

How to debug Greasemonkey scripts in Firebug?

风流意气都作罢 提交于 2019-12-10 04:30:24
问题 How to debug Greasemonkey scripts in Firebug? I can't debug any Greasemonkey scripts in Firebug because they don't appear in the list under the Script tab (anymore). The answers at "How to debug Greasemonkey script with the Firebug extension?" apparently don't work with the latest versions of Firefox + Firebug? I've tried: Creating a new Firefox profile about:config setting extensions.firebug.filterSystemURLs to false Updating to Firebug 2.0.2 I had this problem before and solved it by

Compile greasemonkey script into xpi to save file?

↘锁芯ラ 提交于 2019-12-09 23:57:15
问题 if i compile a greasemonkey script into an xpi, then can that xpi access to local file to read and write files from hard disk??? question 2, if i save data using SetValue API of GM then do i need to del the value or does it gets deleted automatically when i restart the FireFox browser?? 回答1: if i compile a greasemonkey script into an xpi, then can that xpi access to local file to read and write files from hard disk??? yes it could, because it is then a firefox extension, but it would mean

Why is $ undefined when I try to use jQuery in GreaseMonkey?

好久不见. 提交于 2019-12-09 17:10:27
问题 I'm totally new to GreaseMonkey, but I'm trying to make a little script. // ==UserScript== // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js // ==/UserScript== (function() { $ = unsafeWindow.jQuery; alert($); // this gives 'undefined' }()); Why does the alert give undefined and how to fix this? UPDATE I tried this: (function(){ //boilerplate greasemonkey to wait until jQuery is defined... function GM_wait() { alert('ok'); if(typeof unsafeWindow.jQuery == 'undefined')

ReferenceError: GM_xmlhttpRequest is not defined

北战南征 提交于 2019-12-09 15:21:26
问题 I get a ReferenceError in the following userscript code: // ==UserScript== // @name ... // @namespace ... // @description ... // @include ... // @grant GM_xmlhttpRequest // ==/UserScript== console.log(GM_info); try { console.log(GM_xmlhttpRequest({ method: "GET", url: "http://google.ca/", synchronous: true }).readyState); } catch (e) { console.log(e); } ... It first logs GM_info successfully, then logs the ReferenceError. (I'm using Firefox/Firebug.) ReferenceError: GM_xmlhttpRequest is not