greasemonkey

id of a link that a function is called from

守給你的承諾、 提交于 2019-12-13 07:49:31
问题 I hope it's not a problem to post much specific code here, but I figure it will be better explained if everyone can just see it, so I will give you my code and then I will explain my problem. My code: function addBeGoneLinks () { var beGoneClassElems; var beGoneSpan; var beGoneLink; var beGonePrintSafe; var spacesSpan; //var middotSpan = document.createElement ('span'); var interactionContainer = document.getElementsByClassName('feedItemInteractionContainer'); for (var i=0; i<children.length;

How to use ajax to post form data with non-UTF8 url-encoded string

故事扮演 提交于 2019-12-13 06:08:38
问题 I'm writing a greasemonkey script to add some features to one webpage(so clearly I can't change the code of the server side). This is a really old website which only receives GBK encoded string. For example, the form in current webpage have a text input field filled up with value "中"("\u4e2d", "%E4%B8%AD" in UTF-8 byte stream, %D6%D0 in GBK byte stream), when the user clicks the submit button, the browser will automatically serialize the form to application/x-www-form-urlencoded text then

Using Greasemonkey to execute Javascript every 5 seconds? [duplicate]

拈花ヽ惹草 提交于 2019-12-13 05:08:59
问题 This question already has answers here : Call a Javascript function every 5 seconds continuously [duplicate] (5 answers) Closed 4 years ago . I am new to Greasemonkey and javascript but have found the script below, I want to execute it every 5 seconds. javascript:$('.comments-stream .more:not(.dnone)').parent().find('.fa-minus').parent() .click(); Is there any way of doing this? 回答1: Use setInterval . Notice how i removed the parentheses from the click function. javascript:setInterval($('

How to programmatically open login window using GreaseMonkey userscript for implicit grant authorization

最后都变了- 提交于 2019-12-13 03:34:36
问题 How do I code my GreaseMonkey userscript to take me to an authorization/login window while on a different website (www.sharelatex.com)? My understanding was that GM_xmlhttpRequest would perform this function, and while I get an "OK" status after GM_xmlhttpRequest has successfully loaded, no login window presents itself. Should I be using a different function? This login must be done programmatically so that the userscript can "catch" the token number that gets attached to the redirect URL

Getting Greasemonkey to interpret JSON data

别等时光非礼了梦想. 提交于 2019-12-13 02:37:27
问题 I'm trying to get Greasemonkey to automate a site for me, and I don't want to extract the info one at a time. So I had a look around and discovered jQuery. Being very new to Greasemonkey scripts, I still find it a bit tough, but if someone could point me in the right direction it would help a lot. I want Greasemonkey to extract information in files that I presume are linked to jQuery. When I run Firebug on the page I get: http://www.trada.net/javascript/jquery-1.4.2.min.js http://www.trada

Automatically Convert Prices on a Web Page to A Different Currency

微笑、不失礼 提交于 2019-12-13 01:35:24
问题 I am interested in possible methods of automatically converting the prices given when a web page is loaded from the currency given to a specified currency. Ideally, the conversion would also make use of the current exchange rate to give valid prices. For example, in my specific case, I would like to convert the prices given in Euros (€) on this web site to Sterling (£). I am looking at using a GreaseMonkey script for this conversion, but can anyone suggest other methods? Thanks, MagicAndi.

Issues making a flyover image popup in a Greasemonkey script

孤街浪徒 提交于 2019-12-13 00:09:33
问题 I started writing a Greasemonkey script as a start for learning JavaScript. What the script does is simply when you hover your mouse pointer over a thumbnail image, if enlarges that picture to a popup window. And I'm almost done. But there's a few snags... when the mouseenter event fires, it spawns a popup and it also loads that same image in the webpage itself! Thus preventing it from executing the mouseleave part too, I think. How do I set the width and the height of the popup dynamically

Adding keylistener and using javascript to click a link in Greasemonkey

浪尽此生 提交于 2019-12-12 18:38:22
问题 I want to create a greasy monkey script , which will add a shortcut key for logout action in one mail site. Currently the logout link "?logout&hl=en" which have an id=":r5" . I am able to get the node for the link but not able to call click on it. I tried the script as following function key_event(event){ GM_log("Hello"); GM_log(event.keyCode); //if(event.keyCode != 112) return; e=document.getElementById(':r5'); if(!e) {return;} var evObj = document.createEvent('MouseEvents'); evObj

Greasemonkey script to replace jQuery plugin function?

◇◆丶佛笑我妖孽 提交于 2019-12-12 18:32:54
问题 I'm trying to write a Greasemonkey script for Firefox to change the behavior of some pages when they detect a window out of focus. I want the page to continue to function as if it were still in focus, even when I have another tab or window active. I started out looking at CAPS Security Policies which seemed to work for inline Javascript ( window.onfocus , window.onblur ), but had no effect on external jQuery script plugin access to focus events. This is my test page, which uses a jQuery

HTML - Click on button causes list to scroll on top for unknown reasons

我只是一个虾纸丫 提交于 2019-12-12 18:29:25
问题 I am using tampermonkey to add some custom buttons to the Unity Documentation. I noticed a strange problem If I am using a html <button> . Everytime when I click on the button, then the scroll list is scrolling to the top and the code is only executed on the second click. However, If I replace <button> with <div> then everything is working perfectly fine. Why is <button> behaving so weird? Below is the tampermonkey script for reproduction. // ==UserScript== // @name Unity Documentation