Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>greasemonkey is not too hard to learn, most of the coding is simply javascript. tampermonkey is simply an addon for chrome that enables certain greasmonkey-specific coding. (for what you are doing this is probably not required)</p> <p>should only take a few lines to inject your .js and .css</p> <p>i believe you actually want your stuff to run after the source page has fully loaded, if run before it will be overwritten by the source when it loads</p> <p>here is my code that does a simple mod to facebook:</p> <pre><code>var script = document.createElement('script'); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(script); script.addEventListener('load', function(){ $ = unsafeWindow['jQuery']; $.noConflict(); // all jQ code goes below here // --------------------------- function doFont(){ $('.fbChatTabSelector .numMessages').css('font-size','8px'); // change font smaller on red chat bubble $('.fbChatTabSelector .numMessages').css('color','yellow'); // change font color on red chat bubble $('.fbJewel .jewelCount').css('color','yellow'); // change font color of red bubble up top (alert jewel) } window.setTimeout(doFont, 30000); // wait 30 seconds and apply changes. i only do this because fb loads in chunks and my script executes before the entire page is loaded. you would only need this if your source page loads alot ofstuff with ajax //------------------------------------ // end jQ code }, false); </code></pre> <p>hope that helps</p> <p>this question is also relevant to my interests because i want to @require jquery and just use it within greasemonkey - but the only construct i could get working is the one above which actually downloads the script again with every page load.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload