tampermonkey

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", " "

Tampermonkey jQuery require not working

て烟熏妆下的殇ゞ 提交于 2019-12-22 05:16:26
问题 I am trying to modify a piece of code I wrote for Grease Monkey to make it compatible with Tampermonkey. Tamper monkey keeps saying '$' is not defined despite my @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js. The require works on Greasemonkey. The Tampermonkey instaled function(s) overview recognizes the JQuery require. // ==UserScript== // @name Function // @version 1 // @run-at document-end // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min

Why doesn't this script work with successive page clicks?

可紊 提交于 2019-12-22 00:36:00
问题 I am currently using the following script in Tampermonkey in Google Chrome: // ==UserScript== // @name Youtube opt in Ads per channel // @namespace schippi // @include http://www.youtube.com/watch* // @version 1 // ==/UserScript== var u = window.location.href; if (u.search("user=") == -1) { var cont = document.getElementById("watch7-user-header").innerHTML; var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); window.location.href = u+"&user="+user; } It seems to work perfectly

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

How to replace @media (max-width) using Stylish or Greasemonkey?

断了今生、忘了曾经 提交于 2019-12-21 21:40:02
问题 I'm having a problem viewing this website on my desktop browser. They have a responsive/fluid design that shows a mobile menu button instead of a horizontal nav-bar when the browser width is less than 990px. Since I'm using Firefox with 125% zoom, my desktop browser is less than 990px effective width. I looked into the CSS code and found the line. How can I use Stylish, Greasemonkey, or some other way to automatically replace the max-width value of "990px" with "800px"? @media (max-width

Greasemonkey AJAX request from a different domain?

偶尔善良 提交于 2019-12-21 05:02:44
问题 I'm trying to get JavaScript (with Greasemonkey) to pull data from my own site to customize another site. The code I'm using is as follows: function getURL(url, func) { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.onload = function (e) { if (xhr.readyState == 4) { if (xhr.status == 200) { func(xhr.responseText, url); } else { alert(xhr.statusText, 0); } } }; xhr.onerror = function (e) { alert("getURL Error: "+ xhr.statusText); // picks up error here }; xhr.send(null); } The

Trying to load jquery into tampermonkey script

泪湿孤枕 提交于 2019-12-20 08:04:11
问题 I am writing a script which logs into my college network when the login page is loaded. The code looks as follows // ==UserScript== // @name My Fancy New Userscript // @namespace http://use.i.E.your.homepage/ // @version 0.1 // @description enter something useful // @match <College login page> // @copyright 2012+, You // ==/UserScript== $(document).ready(function() { var usr=document.getElementsByName("username"); var pass = document.getElementByName("password"); usr.value="usrname"; pass

Greasemonkey is unable to find/modify/delete content? (on Twitch.tv)

≡放荡痞女 提交于 2019-12-20 05:31:44
问题 I'm trying to remove various games off the twitch sub-page "Game List" (twitch.tv/directory) but I'm getting nowhere. I've debugged with alert, timers and @run-at document-end to no avail, the script reaches the page correctly but once I try to manipulate content nothing happens. This is what I use to test it: // ==UserScript== // @name TwitchDeleteTest // @namespace to.be.continued // @include http*://*twitch.tv/directory* // @version 1 // @grant none // ==/UserScript== var rmLoL = document

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

How to include Local htm pages in a Tampermonkey script?

雨燕双飞 提交于 2019-12-20 03:21:48
问题 The script below works on a normal webpage, but how I can make it work on local .htm files too? (When opened in the Chrome browser) // ==UserScript== // @name betterTwitter // @version 0.5 // @namespace http://www.h4xful.net/ // @description Gets rid of the garbage on Twitter's side-panel. // @include http://twitter.com/* // @include https://twitter.com/* // @include file://C:/Users/*.htm ... ... The last line ( @include file:... ) doesn't work at all. The script doesn't fire for a sample