userscripts

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

Programmatically Click on Label/Radio or Fire Event

随声附和 提交于 2019-12-11 17:16:37
问题 I'm writing a userscript that injects a custom javascript into the head of a page. Easy peasy // ==UserScript== // @name *** (BLOCKED DUE TO NDA) // @namespace *** (BLOCKED DUE TO NDA) // @description *** (BLOCKED DUE TO NDA) // @include *** (BLOCKED DUE TO NDA) // @author Aaron K. Henderson // @version 1.0 // ==/UserScript== var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type= 'text/javascript'; script.src= '***.js'; head.appendChild

Log a web page's dynamically-created tag attributes with a userscript

依然范特西╮ 提交于 2019-12-11 14:12:24
问题 I am able to track all the dynamically created tags, using Brock Adams' answer to "Log a web page's dynamically-created, DOM elements with a userscript". Now I want to get the attributes of the tags. I tried it by adding an if condition in LogNewTagCreations () but it didn't work. In this example I am checking attributes for script tags: if(tagName=="script") { console.log("------------",elem.attributes.src.Value); } Please help me. 回答1: Because a <script> s src is set outside the

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

How to add frames to an existing frameset using userscript?

烂漫一生 提交于 2019-12-11 09:44:37
问题 The target page has a simple HTML setup: <html> <body> <frameset id="mainset" rows="50%,50%"> ... </frameset> </body> </html> and I'd like to add frames using JavaScript. This doesn't work: var parent = document.getElementsByTagName("frameset")[0]; var child = document.createElement("frame"); child.src = "about:blank"; child.style = "background-color: red;"; parent.appendChild(child); This does work, but it creates an iframe: var parent = document.getElementsByTagName("body")[0]; var child =

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

What are the differences between Fx 3.x and Fx 4.x that made many userscripts stop working?

夙愿已清 提交于 2019-12-11 04:49:05
问题 I develop scripts for userscripts.org and just upgraded my fx from 3.6.16 to 4.0, but many scripts of mine stopped working with the following message error: Error: Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIXPCComponents_Utils.evalInSandbox] Source code: file:///xxx.user.js I know this message means some kind of "infinite" process, but it doesn't appear any line number that can help me to figure it out. Any help/answer/link is welcome. Operating System: Windows 7

How to “pop out” an IFRAME within my document?

假如想象 提交于 2019-12-11 04:48:25
问题 I am loading a page from the same domain into an iframe on my page. After interacting with a JavaScript-driven form in the iframe I then want it to take over entire document. I can't just set my page's location to that of the iframe because there's no way to get it to the state I want it in by passing URL parameters. All references I can find for jumping out of iframe s is about the page in the iframe controlling the popping out. I want to pop out the iframe from code which is in the context

Google Chrome Userscripts reference window.open

不想你离开。 提交于 2019-12-11 04:06:02
问题 I have been trying to figure this one out for a while, but when I try to reference a window that I opened the handle is always undefined. It is worth noting that this is being used in a userscript and here is the snippet in question: var donateWindow; // ###################################################################### // # Show the donation popup and open a window to paypal site // ###################################################################### function showDonateWindow() { if

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