tampermonkey

Greasemonkey AJAX request is not sending data?

不羁的心 提交于 2019-12-10 17:28:26
问题 I am firing a GET request with Greasemonkey's GM_xmlhttpRequest() : $(".getReview").click(function(){ var videoId = $(this).parents("li").find("a").attr("href"); alert(videoId); GM_xmlhttpRequest({ method: "GET", url: "http://www.amitpatil.me/demos/ytube.php", data: "username=johndoe&password=xyz123", headers: { "User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used. "Accept": "text/xml" // If not specified, browser defaults will be used. }, onload: function

Why does my Tampermonkey script throw “Selenium is not defined”?

余生颓废 提交于 2019-12-10 10:53:42
问题 I am trying to make it where every time I visit a nike.com sneaker page, it automatically picks my shoe size, adds it to the cart, and checks out for me. Every time I try to run the script, I keep getting this error ERROR: Execution of script 'My Fancy New Userscript' failed! selenium is not defined Here is my script: // ==UserScript== // @name My Fancy New Userscript // @namespace http://*/* // @version 0.1 // @description enter something useful // @match http://*/* // @copyright 2012+, You

Tampermonkey - Right click menu

有些话、适合烂在心里 提交于 2019-12-09 16:45:00
问题 With Tampermonkey is there any way to create a right click menu option in Chrome? I found GM_registerMenuCommand but it does not seem to show any new items in the right click menu. Another problem is I use GM_openInTab in the test script but it seems to loop infinitely for some reason. It should only trigger after the menu is clicked, why would this happen? Also I am wondering is there a way to do this in a more advanced way with custom right click icons etc? There was a GM script for Firefox

Can a webpage detect a tampermonkey userscript?

。_饼干妹妹 提交于 2019-12-09 10:34:17
问题 My question is sort of two-fold. First , how the sandbox model works, how it impacts the userscript, what is accessible / seen from the webpage and userscript point of view, and if using a different sandbox model affects the page being able to notice your script being injected into the page (or not). Second , how scripts are injected into the page, and can the page detect it? First From what I can see, when you use @grant none , the sandbox is disabled and you will have access to the webpage

Replaceing/swapping JavaScript file in html using Greasemonkey

余生颓废 提交于 2019-12-08 14:24:33
问题 My goal is to replace an original JavaScript file from a web-page with my home-made file that I have locally. I have found an interesting script here which I repurposed to fit my objective. // ==UserScript== // @name JS_tamper // @namespace namespace // @include http://192.168.1.1/* // @version 1 // @grant none // @run-at document-start // ==/UserScript== var newJSFile = "http://localhost:8080/tamper.js"; //The JS file to load in replacment of old JS file var oldJSFile = "http://192.168.1.1

How to change a link's text based on different phrasing of the link's title attribute?

99封情书 提交于 2019-12-08 13:10:38
In my Fantasy football page, it gives stats about the opposing team and when you mouseover it tells you how many points they give up (See picture). Here is the relevant code pertaining to this: <a class="Inline F-rank-good" title="WAS gives up the 3rd most fantasy points to the QB position." target="_blank" href="/f1/777400/pointsagainst?pos=QB&ntid=28">Was</a> How do I create a Greasemonkey script that will add the # to the end of the team name (i.e. "Was" becomes "Was - 3" One problem there is, is that sometimes the rank says it gives up the "2nd fewest points", in which case you would have

Change CSS of the content of an iframe, that has src=“about:blank”, on Chrome

半城伤御伤魂 提交于 2019-12-08 00:27:32
问题 I'm trying this code to apply new design on the Google Tasks page with the extension Tampermonkey. When I try html{ display: none !important } then It displays nothing as the html tag is not under iframe . however, I couldn't modify under iframe[src="about:blank"] element. How should I modify to make it work? shot 1. : Doesn't work for inside of iframe[src="about:blank"] // ==UserScript== // @name test // @match https://mail.google.com/tasks/canvas // @match about:blank // @grant GM_addStyle

Submit autofill (password input field)

只谈情不闲聊 提交于 2019-12-07 23:54:42
问题 I want to submit an autofilled password form using a userscript/tampermonkey in chrome. However it doesn't work - the fields the password field remains empty (server response or even with alert messages) until the window is actually controlled by a user (any actual keyboard press or mouse click). This seems important if you want a userscript to automate logins without hard-coding the passwords into your userscript. Does anyone have an explanation for that and/or a workaround? I tried all ways

jQuery click() not working in a Greasemonkey/Tampermonkey script

我是研究僧i 提交于 2019-12-07 22:56:25
问题 I am having issues triggering a jQuery click through Greasemonkey/Tampermonkey... jQuery('button').each(function() { jQuery(this).css('background', 'red'); jQuery(this).click(); location.assign("javascript:jQuery(this).click();void(0)"); }​ As you can see I've even tried the location.assign hack but nothing will work, no errors in the console either. Funny thing is that yes, the background colour does change to red so I am assuming it's something in the way .click() works that is different

appendedHow do I extract the text from a (dynamic) div, by class name, using a userscript?

牧云@^-^@ 提交于 2019-12-07 21:03:14
问题 How do I extract the value 2083236893 from the following object using JavaScript? <div class="gwt-Label">2083236893</div> I installed Greasemonkey 3.17 for Firefox 52.2.1 (32-bit) and tested every code example provided and failed. var html = document.getElementsByClassName("gwt-Label")[0]; alert(html.innerHTML); The above example comes from: Accessing Div, by class name, with javascript . Should the code be run on full download of the web page? Appended: var elements = document