I cannot figure out why this does not alert me at least once when I visit http://www.reuters.com. Am I missing something?
// ==UserScript==
// @name test3
// @namespace test3
// @version 1
// ==/UserScript==
$(document).ready(function () {
var actualHost = window.location.toString();
var intendedHost = "www.reuters.com";
alert("Debug 1 - " + actualHost);
if (actualHost == intendedHost) {
alert("Debug 2 - " + actualHost);
}
});
Thank you.
does not work is a really bad description of a problem..
anyway, i see one issue here. try this:
You need to use the
@includedirective that tells GM where the script should run.You should use
unsafeWindowto access the window object of that pageyou also need to load jquery if it doesnt already exist on the page:
thats your new script. it will load jquery for you to use