tampermonkey

Tampermonkey: Trigger event does not work for element

泪湿孤枕 提交于 2020-01-02 20:59:52
问题 I'm trying to add some functionality using Tampermonkey on top of a providers angular application but I'm stuck at this simple thing. I can't replicate the issue using CodePen so we're going to have to go for theories and suggestions. I'll try to be as specific as I can. Adding this interval when the page loads to check when an input with the id serialNumberInput is available. Then I'm adding a dropdown to the form, and attach an onChange event to it to update the serial input field with the

Using SmtpJS in a userscript: Doesn't work, no error messages?

你说的曾经没有我的故事 提交于 2020-01-01 19:23:51
问题 I'm trying to send an email through a userscript using smtpjs because it seems the easiest approach. However it seems more difficult than just sending it by javascript that is embedded in a HTML page. Using this userscript (based on the smtpjs website) I get no error in the console and no email is sent, is this a framework issue or am I missing something here? (if you suggest an easier way to send emails within a userscript don't hesitate to share) // ==UserScript== // @name New Userscript //

How to monitor a static HTML page for changes with Greasemonkey? Use a hash?

余生颓废 提交于 2020-01-01 14:49:24
问题 I want my Greasemonkey script to run ONLY when the static page it's accessing has the exact same content as before... Now I have the ability to set a variable containing a hash of this page. I'm looking for a way to hash the page on the fly, so that I can compare my hash to the generated hash... Any ideas on how to accomplish this, on the fly, hashing? 回答1: From your question: I want my Greasemonkey script to run ONLY when the static page it's accessing has the exact same content as before...

Automatically run JavaScript code upon loading a specific website

北城余情 提交于 2019-12-31 22:27:53
问题 I've written scripts to filter out threads and posts in a programming forum by author. But you need to post the code into the web console for each page individually. I was wondering if it were possible and if so how (using either firefox or chrome), to set your browser up to run a specific script upon loading a specific site? Is it possible as an extension or plugin? 回答1: You can use Tampermonkey for Google Chrome Tampermonkey is the most popular userscript manager for Google Chrome.

Userscript to hide a child node of a cross-domain iframe

ε祈祈猫儿з 提交于 2019-12-31 03:51:17
问题 I want to hide the comments with some words inside by a (Tampermonkey) user script. As an example, I tried to apply a script // ==UserScript== // @name Hide CNN // @match http://www.cnn.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js // @grant GM_addStyle // @run-at document-end // ==/UserScript== $('div.post-body:contains("Abbas")').hide() to the page http://www.cnn.com/2014/07/08/world/meast/mideast-tensions/index.html?hpt=hp_t1 with the following code for

Userscript to Click a “Refresh” button every minute except when there is input?

蓝咒 提交于 2019-12-31 03:13:22
问题 I'm trying to create a Tampermonkey script that would click the page's "Refresh" button every so often, preferably every minute. It would be even better if it could pause while you are performing other actions on the site like typing but that's more optional. Reason for this is that we are using a website at work that needs us to keep track of incoming customer requests in a timely manner but the site only has an integrated refresh button that needs to be clicked manually and doesn't refresh

Get headers of all requests related to a page with tampermonkey

僤鯓⒐⒋嵵緔 提交于 2019-12-30 14:18:52
问题 I'm trying to write a tampermonkey script which gathers the document.location and headers in a dictionary. Googled a bit and figured I was supposed to use a global variable of some sort, but it's not working as I want. Here's the script: // ==UserScript== // @name My Fancy New Userscript // @namespace http://your.homepage/ // @version 0.1 // @description enter something useful // @author You // @match *://*/* // @grant none // ==/UserScript== if (unsafeWindow.resources == undefined) { var

Code working in browser console but not in tampermonkey

戏子无情 提交于 2019-12-28 04:33:11
问题 I am trying to run the following block of code on https://lichess.org/uZIjh0SXxnt5. var x = document.getElementsByTagName("a"); for(var i = 0; i < x.length; i++) { if(x[i].href.includes("WaisKamal") && x[i].classList.contains("user_link")) { x[i].innerHTML = '<span class="title" data-title="GM" title="Grandmaster">GM</span> ' + x[i].innerHTML; } if(x[i].href.includes("WaisKamal") && x[i].classList.contains("text")) { x[i].innerHTML = '<span class="title" data-title="GM" title="Grandmaster">GM

Apply a Greasemonkey/Tampermonkey/userscript to an iframe?

Deadly 提交于 2019-12-28 02:08:47
问题 The title is pretty much the question: Is it possible to add a Greasemonkey script to an iframed website? If so, how? Thank you. 回答1: In Greasemonkey (And Tampermonkey and most userscript engines) a script will fire on an iframe automatically if it meets the @include, @exclude, and/or @match directives. And, a popular question is how to stop Greasemonkey from firing on iframes. So, if your script had a match like: @match https://fiddle.jshell.net/* It would fire on jsFiddle "output" pages

Using grease/tampermonkey, how can I have the currently viewed definition at Dictionary.com open at Thesaurus.com?

依然范特西╮ 提交于 2019-12-25 16:50:42
问题 Using Greasemonkey or Tampermonkey, how can I have the currently viewed definition at Dictionary.com open at Thesaurus.com (and vice versa) when the links circled in red are clicked. I see that I can use window.location.pathname to retrieve "/browse/test" or whatever word is being searched, which I can then put on the opposite link's hostname. The HTML of the Thesaurus.com link: <a href="http://www.thesaurus.com/" data-linkid="qxnxzj">Thesaurus.com</a> The HTML of the Dictionary.com link: <a