tampermonkey

Toggling click handler using waitForKeyElements

 ̄綄美尐妖づ 提交于 2019-12-12 05:13:30
问题 I recently discovered, waitForKeyElements. An amazing utility from BrockA. I'm using the userscript below in Tampermonkey to automatically accept chats from SalesForce's LiveAgent. Works great, my question is if there's a way to add a button or a link to toggle between it, without having to flip the disable & enable switch on Tampermonkey, and then refreshing the page? Any help is greatly appreciated since I've spent a few days looking for an answer, and very little to show for. Thanks in

How to set the event to be triggered first?

狂风中的少年 提交于 2019-12-12 04:15:54
问题 I want to inject the javascript code to the website by Tampermonkey(a browser plugin which can inject userscript) I want to inject: function temp() {...} window.addEventListener("beforeunload", temp); the website may already has window.onbeforeunload = function() {...} window.addEventListener("beforeunload", otherFunction); ...etc, that is, the window object already has some events, and I even don't know what's their function name, and my "temp" function will be attached on window object last

TamperMonkey userscript doesn't fire DOMContentLoaded event

自古美人都是妖i 提交于 2019-12-12 03:09:53
问题 This is a TamperMonkey userscript. Why doesn't "HELLO" popup? I am running Google Chrome on Ubuntu. // ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match http://*/* // @match https://*/* // @grant none // ==/UserScript== window.addEventListener("DOMContentLoaded", function(event) { alert("HELLO"); }); 回答1: Use this: // ==UserScript== // @name New Userscript // @namespace http:/

dynamically change Tampermonkey script in Safari

浪子不回头ぞ 提交于 2019-12-11 13:22:03
问题 How can I make dynamically changed user script using Tampermonkey in Safari without actually open Tampermonkey and edit some code manually? I want to change the contents of a script on the fly. I used to do this in Chrome with @require attribute pointing to a javascript file in my file system. Then I programatically changed that javascript file accordingly. Worked like a charm. This doesn't work with Safari, due to it's security. I tried manually changing the /Users/mainuser/Library

Want to get all elements from the table [duplicate]

本秂侑毒 提交于 2019-12-11 10:32:50
问题 This question already exists : get access to table in the iframe Closed last year . 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, i try to get all elements from the table, i do it with selector like this var rows = document.querySelectorAll("#app table.table-component tr"); but all i have is undefined ^( , please give me some tips how

run user script on chrome://settings and similar urls

坚强是说给别人听的谎言 提交于 2019-12-11 06:07:57
问题 Why doesn't tampermonkey work on urls such as chrome://history/ or chrome://settings/ ? Any way to run an user script on this pages as well? 回答1: Unfortunately, this isn't possible, because the chrome scheme ( chrome:// ) isn't supported in @match 's abilities. UserScripts also use Chrome's match spec, so a Chrome extension to do that wouldn't work either. From the linked spec: Host permissions and content script matching are based on a set of URLs defined by match patterns. A match pattern

Code from bookmarklet works in console but not in my Tampermonkey script?

馋奶兔 提交于 2019-12-11 05:03:12
问题 tl;dr Don't use exotic dynamic injection of external libraries in Userscript. @require them instead. Original Question I am trying to modify this page with the following script: console.log("run"); !function(){var e=document.createElement("SCRIPT") e.src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",e.type="text/javascript",document.getElementsByTagName("head")[0].appendChild(e) var t=function(e){window.jQuery?e(jQuery):window.setTimeout(function(){t(e)},100)} t(function

Can I make a tampermonkey userscript reload the page when encountering 500 http codes?

泪湿孤枕 提交于 2019-12-11 02:56:48
问题 I have a userscript that travels from one page to another (using window.location). In about 10% times the page fails to load because of the target website being overhelmed by it's hude traffic (at times) or due to some other reasons. Refreshing fixes the issue, but it requires my presence, which is very limiting. How can I get my userscript to reload the page? I haven't found a way to include the chrome's error page into @includes. 来源: https://stackoverflow.com/questions/21303027/can-i-make-a

How to debug Greasemonkey/Tampermonkey userscripts with FF 57+ (with WebExtensions)?

女生的网名这么多〃 提交于 2019-12-11 02:24:41
问题 I can't find my userscript(s) in the Browser Debugger's Open file... box (with the name defined at // @name ). It seems that Annarfych's answer and Hjulle's answer to How to debug Greasemonkey script with the Firebug extension? do not work any more. Because of Michael's findings to Greasemonkey script folder missing? Apparently GreaseMonkey no longer stores the user scripts in gm_scripts for Firefox. [...] the scripts are apparently stored in an SQLite database file. 来源: https://stackoverflow

Greasemonkey to Modify Text based on other parts of the webpage?

纵饮孤独 提交于 2019-12-10 22:26:24
问题 The Backstory: I am looking to improve a Fantasy Football webpage by adding stats of the players in real-time. Let's assume we are using this page as a reference. For each player, it lists the position they play (i.e. QB, WR, etc) and also the team they play against. My Current Code: @BrockAdams answered my question yesterday and was able to assemble a table that contained the team name, position, and the rank. Here is a sample of the table: What I am looking to accomplish is lookup the rank