Danbooru

Danbooru Ignore User Greasemonkey Script

Posted under General

RaisingK said:
You go to the trouble of using localStorage instead of GM_setValue() and GM_getValue(), yet you use GM_addStyle() without defining it for non-Greasemonkey systems...

Gm_setvalue and related commands do not work that well in Chrome. Moreover, non-greasemonkey systems? It works quite well in chrome without need for greasemonkey at all. I'm not sure how this is a problem.

I haven't tested other browsers/older versions besides the recent stable builds of firefox and chrome, but if people want me to include support for them, I can see what I can do.

RaisingK said:
You go to the trouble of using localStorage instead of GM_setValue() and GM_getValue(), yet you use GM_addStyle() without defining it for non-Greasemonkey systems...

GM_addStyle() is natively supported by Chrome nowadays, along with a few other GM functions: http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/resources/greasemonkey_api.js

Although apparently it's only defined in the context of a user script, since putting "javascript:alert(typeof(GM_addStyle))" in the address bar returns "undefined".

westisblue said:
It works quite well in chrome without need for greasemonkey at all. I'm not sure how this is a problem.

I said "non-Greasemonkey", not specifically Chrome. Opera can run userscripts, too. Better to not rely on anything in the GM API if portability is a concern.

Updated

RaisingK said:
I said "non-Greasemonkey", not specifically Chrome. Opera can run userscripts, too. Better to not rely on anything in the GM API if portability is a concern.

I can write a wrapper for GM_AddStyle if anyone is running this on Opera, but portability is not a big concern for this small script.

1