0

Chrome works just fine, and my Greasemonkey script, if copy/pasted into Firefox's Firebug, works just fine on these pages but I can't seem to get it automatically execute.

Download & install the script: http://sente.cc/js/testing_greasemonkey.user.js

and then go to https://i.stack.imgur.com/MK8ve.jpg (observe simple alert) and https://i.stack.imgur.com/q0tbI.jpg (observe no alert)

the script:

// ==UserScript==
// @name          Testing Greasemonkey
// @namespace     stuartpowers
// @description   Testing Greasemonkey
// @author        Stuart Powers
// @homepage      http://sente.cc/
// @include       http://i.imgur.com/*
// @include       http://imgur.com/*
// ==/UserScript==


// load https://i.stack.imgur.com/MK8ve.jpg (works)
// load https://i.stack.imgur.com/q0tbI.jpg (doesn't work)

(function () {
    alert("worked");
})()
Brock Adams
  • 90,639
  • 22
  • 233
  • 295
sente
  • 2,327
  • 2
  • 18
  • 24

1 Answers1

2

No, Greasemonkey requires an explicit DOM to fire and act upon. It cannot run on Chrome-generated1 pseudo-DOM2.

If you want to act on these kind of "pages", you'll have to write a Firefox extension (add-on). (Note that userscripts in Google-Chrome are converted into mini extensions.)

Here are some add-on resources, I've found helpful:



1 Here, "Chrome" refers to the privileged DOM that makes up the Firefox's UI.
2 With select exceptions.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295