Created
September 3, 2012 01:36
-
-
Save nthx/3606120 to your computer and use it in GitHub Desktop.
Hello World TamperMonkey script with jquery/sugarjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @match https://yourwebsite.com/xyz | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// @require http://cdnjs.cloudflare.com/ajax/libs/sugar/1.3/sugar.min.js | |
// ==/UserScript== | |
alert('Hello, I got jQuery included and sugarJs too'); | |
var runEverySecond = function(){ | |
$('p').find('img').attr('width', '0px'); | |
$('a').css('padding', '0px'); | |
console.debug('Hello Word has ' + $('p').length + ' paragraphs'); | |
}; | |
$(document).ready(function() { | |
setInterval(runEverySecond,1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work for me. I'm getting the following error on Chrome with Tampermonkey:
ERROR: Execution of script 'XX' failed! undefined is not a function