userscripts

Greasemonkey/Tampermonkey script to redirect to doubly modified URL

ぐ巨炮叔叔 提交于 2019-12-23 01:01:18
问题 The target page has the URL: ouo.io/tLnpEc.html And I want to change the URL to: ouo.press/tLnpEc That is: .io to .press and remove .html . I already have this but it ain't working (It redirects to ouo.press but still doesn't remove .html): var url = window.location.host; if (url.match("//ouo.io") === null) { url = window.location.href; if (url.match("//ouo.io") !== null){ url = url.replace("//ouo.io", "//ouo.press"); } else if (url.match("/*.html") !== null){ url = url.replace("/*.html", " "

Greasemonkey script to move an element into another element?

做~自己de王妃 提交于 2019-12-22 09:48:54
问题 I want to move <div> elements. In this case, swap the first and last div.clearfix . So this: <fieldset> <div class="clearfix "> <label for="form-title">Title</label> <div class="input"></div> </div> <div class="clearfix "></div> <div class="clearfix "> <label>Verification</label> <div dir="ltr"> recaptcha </div> </div> </fieldset> Would become this: <fieldset> <div class="clearfix "> <label>Verification</label> <div dir="ltr"> recaptcha </div> </div> <div class="clearfix "></div> <div class=

How to detect if a userscript is installed from the Chrome Store?

浪尽此生 提交于 2019-12-21 22:56:59
问题 I want to notify the user when an update for my Greasemonkey/UserScript is available. However when the user has installed the script from the Chrome Web Store, I don't want to bother because it has auto-update functionality. I first thought about using $.browser==chrome but it is also possible that a Chrome user has installed it using Tampermonkey. (Furthermore if the site would update jQuery, $.browser would stop working) So, is it possible to detect that it is a UserScript installed through

Userscript to click button

ぃ、小莉子 提交于 2019-12-21 18:33:08
问题 I would like to click a buy now button using greasemonkey. // ==UserScript== // @name script // @namespace sc // @include * // @version 1 // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // ==/UserScript== waitForKeyElements ("#buy-now", triggerMostButtons); function triggerMostButtons (jNode) { triggerMouseEvent (jNode[0], "mouseover"); triggerMouseEvent (jNode[0],

Enable a non-PlayStore UserScript with Chrome 35 and above

穿精又带淫゛_ 提交于 2019-12-20 09:19:27
问题 Since the version 35 of Google Chrome, the execution of any extension installed outside of the Google's PlayStore is blocked and cannot be enabled from the extensions menu. The auto-installation of non-store scripts was removed two years ago but downloading the script and performing a drag & drop on the extensions menu still allowed the installation, so it was still possible to create and share scripts for Google's Chrome. But now everything is locked. Is it possible to manually add

How to write userscript for a dynamic website [duplicate]

丶灬走出姿态 提交于 2019-12-20 06:47:12
问题 This question already has answers here : Run Greasemonkey script on the same page, multiple times? (2 answers) Closed 4 years ago . **First of all, i'm sorry for my bad english! I am trying to write a userscript for some website. This website updates himself every click or some seconds. (it uses ajax to update the view without refreshing) My userscript have to append some html elements when the user is in certain view. How can i run my code every view change? (after ajax) The page have a

How to loop through GET/POST calls sequentially (waiting for previous) return?

*爱你&永不变心* 提交于 2019-12-20 04:35:06
问题 I'm writing a Tampermonkey script for a web page and trying to extract data from other pages. I'm trying to make a function that has a loop inside that goes thru a list, llcList , and retrieves data from ajax method GET, but would like to wait for to finish one request before going to second one. Bonus would be if I could make it wait some extra time. What should happen: send request for a llcList[0] get return data, process it wait some time send new request for a llcList[1] Is this possible

CKEditor variable is available in console, but not from a Chrome userscript?

假装没事ソ 提交于 2019-12-20 03:02:35
问题 I'm writing a Chrome userscript to locally auto-save content in a CKEditor . I'm using this CKEditor auto-save plugin as inspiration. I have written a function that fires every half second (via an interval) to register the CKEditor event handler: var intervalId = window.setInterval(function() { if (CKEDITOR) { window.clearInterval(intervalId); CKEDITOR.plugins.add("user-script-auto-save", { init : function(editor) { editor.on('key', startTimer); } }); } }, 500); However, it never properly

Getting jQuery and GM_addStyle to work in a Chrome userscript based off of a working Greasemonkey script

倾然丶 夕夏残阳落幕 提交于 2019-12-20 02:54:57
问题 I wrote a simple Greasemonkey script that enlarges thumbnail pictures in a flyover popup. It uses a lot of jQuery in it. It works just fine on Firefox. But not on Chrome since it doesn't support @require. I came across this solution for this matter. But the script didn't work on Chrome even after I integrated it with the get-around code. I just put all my script code inside the solution code's main function. Is it wrong? If anyone can point out where is the problem, and what I can do to get

Question about setTimeout that I need answer to

最后都变了- 提交于 2019-12-20 02:06:13
问题 So we all know setTimeout waits a certain amount of time before executing something. My question is, does it wait for the above code to finish executing first, before waiting a second to execute something else, or does it just wait for a second, and whether or not the above code has finished executing, it executes the rest of the code anyways? if (1 == 1) { //huge chunk of code } //end of if (1 == 1) var theTime = 1000; var timeout = setTimeout("location.reload(true);", theTime); function