tampermonkey

Trying to load jquery into tampermonkey script

吃可爱长大的小学妹 提交于 2019-12-02 14:13:21
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.value="password"; var submitButton = document.querySelector ('input[type="submit"][value="Login"]'); var

Promise not returning value of request

被刻印的时光 ゝ 提交于 2019-12-02 12:40:17
问题 I have this promise: function getAPI(token) { return new Promise((resolve, reject) => { console.log("Request API"); GM_xmlhttpRequest({ method: "GET", url: "URL"+token, onload: function(response) { console.log(response.responseText); if( response.responseText == "NOT_ANSWER" || response.responseText.indexOf("ERRO") > -1 ){ console.log(response.responseText + " - Calling Myself in 5 Seconds"); setTimeout(function(){ getAPI(token); },5000); } else{ console.log('Call API - Giving Result');

How to remove CSS Class with Tampermonkey?

一世执手 提交于 2019-12-02 10:31:58
问题 I am very new to CSS and javascript, so take it easy on me. I am trying to remove the class disable-stream from each of the div elements under the div class="stream-notifications". (See image, below) I have tried the following in Tampermonkey, but it doesn't seem to work: (function() { 'use strict'; disable-stream.classList.remove("disable-stream");})(); 回答1: That looks to be an AJAX-driven web page, so you need to use AJAX-aware techniques to deal with it. EG waitForKeyElements, or

How do I get password fields to be autofilled without requiring user interaction?

岁酱吖の 提交于 2019-12-02 09:34:25
问题 If I inspect an <input type="password"/> from my Tampermonkey script and observe changes using a change handler for a password field that is filled by the Password Manager feature of Chrome, the value remains empty until I physically perform a real click in the page. I have tried in my script clicking in the page, but Chrome knows it’s not a real click. When I physically click in the page, the change event suddenly fires, the password field gets a value, and then my script reacts properly

get access to table in the iframe

ぃ、小莉子 提交于 2019-12-02 07:55:33
i have a website , login: cyclefreight1@usa.com pas: 12345678, log in and go to the drivers section(left menu bar firs item > drivers) I want to make some additional function to this web with tampermonkey. All information about drivers consist in the table, and information about current driver is available when you click to "Go to the current log" button i try to add some new functions to the current drivers section all this stuff are in the iframe , so i try to do an event listener to the button like this // @name drivers // @match https://eldclient.trackingmap.eu/drivers* // @grant none //

How to remove CSS Class with Tampermonkey?

谁说我不能喝 提交于 2019-12-02 07:26:27
I am very new to CSS and javascript, so take it easy on me. I am trying to remove the class disable-stream from each of the div elements under the div class="stream-notifications". (See image, below) I have tried the following in Tampermonkey, but it doesn't seem to work: (function() { 'use strict'; disable-stream.classList.remove("disable-stream");})(); That looks to be an AJAX-driven web page, so you need to use AJAX-aware techniques to deal with it. EG waitForKeyElements , or MutationObserver , or similar. Here's a complete script that should work: // ==UserScript== // @name _Remove a

Promise not returning value of request

狂风中的少年 提交于 2019-12-02 07:13:11
I have this promise: function getAPI(token) { return new Promise((resolve, reject) => { console.log("Request API"); GM_xmlhttpRequest({ method: "GET", url: "URL"+token, onload: function(response) { console.log(response.responseText); if( response.responseText == "NOT_ANSWER" || response.responseText.indexOf("ERRO") > -1 ){ console.log(response.responseText + " - Calling Myself in 5 Seconds"); setTimeout(function(){ getAPI(token); },5000); } else{ console.log('Call API - Giving Result'); resolve(response.responseText.split("_")[1]); } } }); }); } I call it inside of itself when the answer is

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

╄→尐↘猪︶ㄣ 提交于 2019-12-02 07:07:47
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.querySelector("a[title='League of Legends']"); var grandParent = rmLoL.parentNode.parentNode;

How do I get password fields to be autofilled without requiring user interaction?

坚强是说给别人听的谎言 提交于 2019-12-02 06:47:26
If I inspect an <input type="password"/> from my Tampermonkey script and observe changes using a change handler for a password field that is filled by the Password Manager feature of Chrome, the value remains empty until I physically perform a real click in the page. I have tried in my script clicking in the page, but Chrome knows it’s not a real click. When I physically click in the page, the change event suddenly fires, the password field gets a value, and then my script reacts properly (due to having the change event). But I wrote this script to avoid having to interact with the page in the

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

五迷三道 提交于 2019-12-02 05:36:55
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? I tried few methods, every time loop send all requests not a second apart. : function F_Company_LLC()