[Greasemonkey] detecting greasemonkey
Mark Pilgrim
pilgrim at gmail.com
Mon Jul 10 12:53:44 EDT 2006
On 7/10/06, Johan Sundström <oyasumi at gmail.com> wrote:
> I'm sure it's theoretically possible. Like, say, create an HTML page
> named something.user.js with a bit of javascript that peeks on
> window.innerHeight and compares with a similar page which doesn't have
> the greasemonkey pop-down saying "Howdy! This is a user script" and
> similar.
You can't do this with iframes, because Greasemonkey won't display the
greeting in iframes. You might be able to do it with a Javascript
redirect that passed through a dummy page named foo.user.js (served as
text/html through .htaccess tricks) and then onto a regular .html page
(where the .js-as-HTML page passed along its own innerHeight as a
query parameter).
The counterattack would be for Greasemonkey to check the MIME type of
.user.js pages and only trigger on text/plain, text/javascript,
application/javascript, application/x-javascript, and probably a few
other commonly used types. I'm a little surprised that it doesn't do
this already.
--
Cheers,
-Mark
More information about the Greasemonkey
mailing list