tampermonkey

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

偶尔善良 提交于 2019-12-02 03:52:51
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 posts <div class="post-body"> <header> ... </header> <div class="post-body-inner"> <div class="post

How to convert a jQuery filter for use with waitForKeyElements?

拥有回忆 提交于 2019-12-02 03:25:28
问题 This code removes tweets with less than 3 retweets, but now I have the refresh (AJAX) issue. How can I add the waitForKeyElements function to fix it? $('.js-stream-item:has(span.ProfileTweet-action--retweet)').filter(function() { return parseInt($(this).find('span.ProfileTweet-actionCount').attr('data-tweet-stat-count')) < 3; }).remove(); 回答1: To convert a static jQuery filter, like that, to an AJAX-aware waitForKeyElements() use is not too hard: Your base selector just becomes the selector

Tampermonkey script to wait for elements then fill them in

可紊 提交于 2019-12-02 03:07:51
问题 I'm trying to finish a script that fills out a checkout form. It needs to click a button with no id or name then fill out the rest of the form that appears. The code I have to click the button is: document.querySelector('input[type="submit"][value="continue"]').click(); but that is not working for me, the other elements will appear after that, my script: // ==UserScript== // @name Script // @include https://checkout.bigcartel.com/* // @include http://*.bigcartel.com/product // @include http:/

How to include Local htm pages in a Tampermonkey script?

蓝咒 提交于 2019-12-02 02:24:14
The script below works on a normal webpage, but how I can make it work on local .htm files too? (When opened in the Chrome browser) // ==UserScript== // @name betterTwitter // @version 0.5 // @namespace http://www.h4xful.net/ // @description Gets rid of the garbage on Twitter's side-panel. // @include http://twitter.com/* // @include https://twitter.com/* // @include file://C:/Users/*.htm ... ... The last line ( @include file:... ) doesn't work at all. The script doesn't fire for a sample page. First, on Chrome's extensions setting page ( chrome://extensions/ ), make sure Tampermonkey has

How to convert a jQuery filter for use with waitForKeyElements?

吃可爱长大的小学妹 提交于 2019-12-02 02:21:11
This code removes tweets with less than 3 retweets, but now I have the refresh (AJAX) issue. How can I add the waitForKeyElements function to fix it? $('.js-stream-item:has(span.ProfileTweet-action--retweet)').filter(function() { return parseInt($(this).find('span.ProfileTweet-actionCount').attr('data-tweet-stat-count')) < 3; }).remove(); Brock Adams To convert a static jQuery filter, like that, to an AJAX-aware waitForKeyElements() use is not too hard: Your base selector just becomes the selector parameter. EG: waitForKeyElements (".js-stream-item:has(span.ProfileTweet-action--retweet)"...

Tampermonkey script to wait for elements then fill them in

只愿长相守 提交于 2019-12-02 00:24:38
I'm trying to finish a script that fills out a checkout form. It needs to click a button with no id or name then fill out the rest of the form that appears. The code I have to click the button is: document.querySelector('input[type="submit"][value="continue"]').click(); but that is not working for me, the other elements will appear after that, my script: // ==UserScript== // @name Script // @include https://checkout.bigcartel.com/* // @include http://*.bigcartel.com/product // @include http://*.bigcartel.com/cart // @grant none // ==/UserScript== // on "/cart" page click checkout button if

GM_openInTab (or any other GM_ function) is not defined?

坚强是说给别人听的谎言 提交于 2019-12-01 21:30:29
When my GM script does this: var curTab = GM_openInTab(url); it results in a 'GM_openInTab is not defined' JavaScript error in the Browser Console. I also tried using var curWin = window.open(url); instead of GM_openInTab but it had no affect. What I'm trying to do with this GM script is: for a given website (domain name), go through a list (array) of URLs on this domain and look for items of interest. What's wrong with my code or approach? I'm using Greasemonkey 2.3 with Firefox 33.1.1 and Windows XP 32-bit. Brock Adams In order to use any of the GM_ functions, you must set a matching @grant

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

只愿长相守 提交于 2019-12-01 21:17:11
问题 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

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

回眸只為那壹抹淺笑 提交于 2019-12-01 19:07:30
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? 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 is essentially a URL that begins with a permitted scheme ( http , https , file , or ftp , and that can

Get headers of all requests related to a page with tampermonkey

扶醉桌前 提交于 2019-12-01 14:12:22
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 unsafeWindow.resources = []; } var host = window.location; unsafeWindow.resources.push(host); console.log