greasemonkey

How to paste text in Pastebin using JavaScript

China☆狼群 提交于 2019-11-30 20:49:28
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.addEventListener("keydown", callkeydownhandler, false); } else { window.document.attachEvent("onkeydown",

Greasemonkey script folder missing

对着背影说爱祢 提交于 2019-11-30 20:46:37
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. Apparently GreaseMonkey no longer stores the user scripts in gm_scripts for Firefox. I have Firefox 58 with GreaseMonkey 4.2 . I

Can Greasemonkey work with the file:// protocol?

旧城冷巷雨未停 提交于 2019-11-30 20:18:21
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 have http* file* in the "Included Pages" box. See "Greaseable schemes" in the Greasemonkey docs .

Can I get the data of a cross-site <img/> tag as a blob?

冷暖自知 提交于 2019-11-30 18:32:30
问题 I am trying to save a couple of images that are linked to by a webpage to offline storage. I'm using IndexedDB on Firefox and FileSystem API on Chrome. My code is actually an extension, so on Firefox I'm running on Greasemonkey, and on Chrome as a content script. I want this to be automated. I am running into problem when I retrieve the image file. I'm using example code from the article titled Storing images and files in IndexedDB, but I get an error: the images I'm trying to download are on

How can I change a JavaScript variable using Greasemonkey?

瘦欲@ 提交于 2019-11-30 16:33:01
This is the page that I am trying to modify, I want to bypass the countdown timer, how should I write the script? Is there a way that I can change the variable document.licenseform.btnSubmit.disabled to yes using Greasemonkey? <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>dsfsdf</title> </head> <body> <form name="licenseform" method="post" action=""> <input name="btnSubmit" type="button" value="我同意"> </form> <SCRIPT language=javascript type=text/javascript> <!-- var secs = 9; var wait = secs * 1000; document.licenseform.btnSubmit.value = "我同意 [" +

Greasemonkey script to work on dynamically loaded posts on Facebook

血红的双手。 提交于 2019-11-30 16:18:49
I wrote a Greasemonkey script and it affect the firstly loaded posts on Facebook. but after you scroll down on the feed, the script doesn't work on the newly loaded posts. Is there a way to re-run the script for those posts, or something like that? can anyone help me? Brock Adams Update: This question and answer are very old and DOMSubtreeModified is deprecated . I no longer recommend this approach. Instead see: Fire Greasemonkey script on AJAX request Run Greasemonkey script on the same page, multiple times? Choosing and activating the right controls on an AJAX-driven site Or use

How do you make Greasemonkey Click a link that has specified text?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 13:06:55
Alright basically i want to click a link that changes but always has the same text name. Heres an example of what the code might be <a href="unlock.php?confirm=MD5hashere">Click Here</a> Brock Adams Here is a starter script that does that. Note that it uses jQuery and assumes you are running Firefox or using Tampermonkey, if you are on Chrome. // ==UserScript== // @name _YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work

How do I pop up a custom form/dialog in a Greasemonkey script?

眉间皱痕 提交于 2019-11-30 10:15:41
I have been working on a script to use as a plugin in Firefox, and have come across the need to pop up a custom form when a certain button is clicked. I need to be able to create the entire form myself and then parse the entered data to render images on the original site. How do I do this? Okay, here is a complete script example, showing how to pop up a form and interact with its controls. Note that it uses jQuery -- which makes it vastly easier/shorter/simpler. // ==UserScript== // @name _Form, popup example // @include http://stackoverflow.com/* // @require http://ajax.googleapis.com/ajax

Greasemonkey, Chrome and unsafeWindow.foo()

筅森魡賤 提交于 2019-11-30 10:04:24
I have the following anchor tag, which contains dynamically-generated arguments arg1,...,arg5 to the JavaScript function foo() , which runs on the web site-side. There are several of these anchor tags throughout the page in question, with unique id values and argN values: <a href="#" id="foo1234567890" onclick="javascript:foo(arg1,arg2,arg3,arg4,arg5);return false;" target="_self" title="foobarbaz"> blah </a> I would like to programmatically fire the foo() function by looping through all hits for this element, searching for the arguments, and passing those arguments to Greasemonkey's

How to run code after changing the URL via window.location?

廉价感情. 提交于 2019-11-30 09:50:40
问题 I'm doing this but it doesn't work: window.addEventListener("load", function load(event){ alert('hola'); },false); window.location.assign("about:blank"); It's a Greasemonkey script. The new location is loaded but the alert is never shown. 回答1: Once you change the window.location , the current instance of your Greasemonkey script is purged. To "run code" after the location change, you need to set the script to trigger on the new page ( about:blank in this case), and then use a flag to signal