greasemonkey

Greasemonkey, delete <a> element

╄→尐↘猪︶ㄣ 提交于 2019-12-02 18:04:43
问题 I have this Greasemonkey script, I originally wanted to get all the <table> elements and search through those for but I couldn't get that to work. So I tried searching for the <a> elements themselves and just hiding them if they contained "http://www.4chanscapepk.t35.com" but its not working either. What am I missing? var results = document.getElementsByTagName("a"); for ( var i=0; i<results.length; i++ ) { if ( results[i].href.indexOf("http://www.unwantedsites.com") == 0 ) { results[i]

How can I get greasemonkey to call a function on a page after it loads

戏子无情 提交于 2019-12-02 17:31:16
I have a very simple greasemonkey script that I want to call an already existing javascript function on the page. I've read the documentation and nothing seems to work window.setTimeout(function() { alert('test') // This alert works, but nothing after it does myFunction() // undefined window.myFunction() // undefined document.myFunction() // undefined }, 1000); Try using: unsafeWindow.myFunction(); More details and info - http://wiki.greasespot.net/UnsafeWindow One way to call a function in the original page is like this: location.href = "javascript:void(myFunction());"; It is a bit ugly.

Follow all users on a twitter page [closed]

偶尔善良 提交于 2019-12-02 17:19:37
I'm on https://twitter.com/#!/username/followers ; is there any greasemonkey script to follow all the twitter users on that page? Here's a new one which also employs a delay to prevent spam issues. var FOLLOW_PAUSE = 1250; var FOLLOW_RAND = 250; var PAGE_WAIT = 2000; __cnt__ = 0; var f; f = function() { var eles; var __lcnt__ = 0; eles = jQuery('.Grid-cell .not-following .follow-text').each(function(i, ele) { ele = jQuery(ele); if (ele.css('display') != 'block') { console.trace('Already following: ' + i); return; } setTimeout(function() { console.trace("Following " + i + " of " + eles.length);

Creating a JQueryscript for GM - Trouble by rewriting the JS code

牧云@^-^@ 提交于 2019-12-02 14:13:23
问题 after trying to solve the problem without and with help I'm still stuck. My aim was writing a GM-script with JS. Someone told me to use jQuery because of its simplicity. Well, I started learning JS last week and my head is full of information. What I need is hint/start/beginning/whatever telling me how to rewrite the script into a fine working jQuery-script. Well, I read some manuals, but somehow I just cannot figure it out. It might be that I misunderstood the syntax of jQuery which can't be

Greasemonkey to redirect site URLs from .html to -print.html?

拈花ヽ惹草 提交于 2019-12-02 13:58:23
问题 Need help making a script for Greasemonkey that will help me read forums more efficiently. Redirect all pages ending in .html : http://www.site.com/thread-category/4525-url.html To this printable version URL: http://www.site.com/thread-category/4525-url-print.html (Add -print , just before ending .html . 回答1: To do this accounting for possible URL parameters and hash tags: // ==UserScript== // @name _Redirect site.com to print.html URL's // @include /site\.com\/thread.+?\.html\b/ // @grant

Is there a way to disable all other Java Scripts other than my own with Grease Monkey

本小妞迷上赌 提交于 2019-12-02 13:41:37
I need help getting a Grease Monkey with JQuery Script to run on a broken site. I'm trying to get the following GM script to run, but the page I want it to work on has a JS error and my JS does not get executed. // ==UserScript== // @name BILL INFO PAGE ALTER // @namespace http://jenkinslaw.org // @description Alter the web page in order to pretty print // @include http://www.legis.state.pa.us/cfdocs/billinfo/bill_history.cfm?* // @require http://code.jquery.com/jquery-1.4.2.min.js // ==/UserScript== */ (function() { //Make a copy of the bill table var bill_table = $('.main_table').clone(); /

Twitter userscript affects pages other than the intended (@included) ones?

烈酒焚心 提交于 2019-12-02 13:37:10
问题 The below UserScript is meant to work on my own twitter profile page (not the timeline). // ==UserScript== // @name CoolScript // @include https://twitter.com/IJNanayakkara // @include https://twitter.com/IJNanayakkara/status/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @version 1.0 // @license GPL v3 or any later version (http://www.gnu.org/copyleft/gpl.html) // @grant GM_addStyle // ==

Use greasemonkey to add HTML before table

元气小坏坏 提交于 2019-12-02 13:30:26
问题 I am using greasemonkey to edit a page. I need to add my own table between the two tables that are already on the page and then remove the second table. There is nothing really setting the two existing tables apart, so I am having trouble with the function to insertBefore . <h3>Table 1</h3> <table class="details" border="1" cellpadding="0" cellspacing="0"> <tbody><tr> <th>1</th> <td>2</td> </tr> </tbody></table> <h3>Table 2</h3> <table class="details" border="1"> <tbody><tr> <th>1</th> <td>2<

Userscript code works in Firefox but not in Chrome? (unsafeWindow)

。_饼干妹妹 提交于 2019-12-02 12:06:00
I am using this userscript in Firefox that counts unread tweets in Tweetdeck and colors the new tweets. It works fine with Firefox (Greasemonkey), but in Chrome I'm not getting anything. Here is the code: // ==UserScript== // @name TweetDeck Unread Notifications // @include https://tweetdeck.twitter.com // @include https://tweetdeck.twitter.com/* // @grant none // ==/UserScript== var head, style; head = document.getElementsByTagName('head')[0]; style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = ".tdUnreadUnread { background-color: #444444; }"; head.appendChild

Pass a variable to new page

江枫思渺然 提交于 2019-12-02 11:51:42
I am trying to pass a variable from one page, load another and enter that information. something Like this: When 127.0.0.1/test.html&ID=1234 location.href = "127.0.0.1/newpage.html" if (location.href == newpage.html){ var e = document.GetElementById("Loginbx"); e.Value = ID } I don't have access to modify 127.0.0.1/test.html nor newpage.html but would like to pass variables to them from another. Is this possible? You could pass the values on the query string and then read those: location.href = "http://127.0.0.1/newpage.html?foo=1&bar=2"; Then use location.search to get the query string and