greasemonkey

Using arrows-keys to navigate

不问归期 提交于 2019-11-30 06:21:54
问题 I am wondering if there was a possibility to navigate with arrow keys through a table I created with JS(using jQuery)? I mean jumping from cell to cell...The script is for Greasemonkey. The alert, however, works. I just got no idea how to make it well-functioning. $(document).keydown(function(e){ if (e.keyCode == 37) { alert( "left pressed " ); return false; } if (e.keyCode == 38) { alert( "up pressed " ); return false; } if (e.keyCode == 39) { alert( "right pressed " ); return false; } if (e

Greasemonkey/Tampermonkey @match for a page with parameters

独自空忆成欢 提交于 2019-11-30 06:15:31
I'm working on a script that must be executed in a certain page, depending on the parameters it has. The URL is like this: http://example.com/page.php?key1=value1&key2=value2&... And I need to match it when page.php has the key1=value1 among its parameters. Now I'm using @match http://example.com/page.php?key1=value1&* But it doesn't match if page.php has no other parameters. It also won't match if key1 is not the first parameter either. Is there any way to match a page according to a parameter? @match only works on the protocol/scheme, host, and pathname of a URL. To trigger off the query

How to paste text in Pastebin using JavaScript

北城余情 提交于 2019-11-30 05:27:53
问题 I'm using Tampermonkey (the same as Greasemonkey, but for Chrome) to make a script. The idea is to paste the text I write into Pastebin. The text was written in other website. I saw I can do it using GM_xmlhttpRequest, but it doesn't work. This is my code: var charac = new Array(50); var i =0 function callkeydownhandler(evnt) { var ev = (evnt) ? evnt : event; var code=(ev.which) ? ev.which : event.keyCode; charac[i]= code; i++; } if (window.document.addEventListener) { window.document

How to embed additional jQuery plugins into Greasemonkey

爱⌒轻易说出口 提交于 2019-11-30 05:27:33
So I've been able to get Greasemonkey and jQuery 1.2.6 to work together without issue, but, now I'm wondering how to embed additional jQuery plugins into my Greasemonkey script, such as Eric Martin's SimpleModal plugin ( http://www.ericmmartin.com/projects/simplemodal/ ). The following code gets jQuery loaded, but I'm not sure how to get SimpleModal loaded properly: var GM_JQ = document.createElement('script'); GM_JQ.src = 'http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js'; GM_JQ.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(GM_JQ); var GM_JQ_SM =

Adding jQuery UI to Greasemonkey script fails with external CSS file

天大地大妈咪最大 提交于 2019-11-30 04:57:42
I'm trying to add jquery-ui to a Greasemonkey script. my full code: test.user.js : // ==UserScript== // @name Test // @namespace rajat.khandelwal // @description Test script // @include * // @require js/jquery-1.6.2.min.js // @require js/jquery-ui-1.8.16.custom.min.js // @require css/ui-darkness/jquery-ui-1.8.16.custom.css // ==/UserScript== alert('hi'); and In current directory I added JS and CSS directory. It throws error saying syntax error in css Error: syntax error Source File: file:///C:/Users/Rajat/AppData/Roaming/Mozilla/Firefox/Profiles/poxivdqy.default/gm_scripts/test/jquery-ui

Greasemonkey script folder missing

爷,独闯天下 提交于 2019-11-30 04:49:40
问题 I am following the instructions to transfer Greasemonkey scripts to Tampermonkey: How to Transfer All Greasemonkey userscripts to Tampermonkey on Firefox 57+. However the folder "gm_scripts" mentioned in the instructions does not exist on my PC. Here are the folders that I do have (Click for larger view): Would you know which of these the scripts may be in? I am a beginner at using scripts and maybe this is not really necessary, but it is good practice for me. 回答1: Apparently GreaseMonkey no

Why does jQuery load twice in my GreaseMonkey Script

余生长醉 提交于 2019-11-30 04:04:21
问题 for some reason my Firefox4+GreaseMonkey Script loads jQuery twice. I copy'n'pasted the following snippet, the "test" alert shows twice. Regards var $; // Add jQuery (function(){ if (typeof unsafeWindow.jQuery == 'undefined') { var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement, GM_JQ = document.createElement('script'); GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; GM_JQ.type = 'text/javascript'; GM_JQ.async = true; GM_Head

Can Greasemonkey work with the file:// protocol?

房东的猫 提交于 2019-11-30 03:39:59
问题 I have a simple Greasemonkey script: // ==UserScript== // @name hello // @namespace http://www.webmonkey.com // @description A test of accessing documents using file:// protocol // @include http* file* // @grant none // ==/UserScript== alert("hi"); It works fine as long as the URL is of the form http://... How do I also get the script to run on URLs of the form file://... ? In the User Settings section I have http://* and file://* as the included pages and in the Script Settings section I

Get subdomain and load it to url with greasemonkey

China☆狼群 提交于 2019-11-30 01:58:15
I am having the URL http://somesubdomain.domain.com (subdomains may vary, domain is always the same). Need to take subdomain and reload the page with something like domain.com/some/path/here/somesubdomain using greasemonkey (or open a new window with URL domain.com/some/path/here/somesubdomain, whatever). var full = window.location.host //window.location.host is subdomain.domain.com var parts = full.split('.') var sub = parts[0] var domain = parts[1] var type = parts[2] //sub is 'subdomain', 'domain', type is 'com' var newUrl = 'http://' + domain + '.' + type + '/your/other/path/' + subDomain

Run Greasemonkey on html files located on the local filesystem?

走远了吗. 提交于 2019-11-30 01:31:36
I have an API documentation lying around on my Harddrive and to ease my workflow, I have written a simple script that modifies the page for my needs. I've developed it using FireBug on FireFox. @include -ing webpages works correctly, but Greasemonkey does not seem to detect pages on the local file-system? I would like to have an include like // @include *R13/Python*R13/* Which should match for example file:///Z:/Eigene%20Dateien/Cinema4D/Documentations/R13/Python%20R13/modules/c4d/index.html But it is not recognized. How can I achieve that the userscript runs on local html files, too? Thanks