[Greasemonkey] Example user script GUI
pilgrim at gmail.com
Wed Apr 20 16:13:39 EDT 2005
On 4/20/05, Edward Lee <edilee at gmail.com> wrote:
> On 4/20/05, Julien Couvreur <julien.couvreur at gmail.com> wrote:
> > In the case of Google Butler, it seems there are many alternative ways
> > to avoid such a invasive UI: a simple link in the Google UI,
> > additional UI in the Google preferences,...
> You can always link to a nonexistant page (assuming no 404 redirect)
> and rewrite the page. It could be a bit tricky without literal html
> blocks/GM_getString right now, but hopefully later it'll be easier to
> place a whole chunk of html with options for the user to set.
I considered this for a feature of Butler that I ultimately cut --
adding additional specialized searches. Just add a link along the top
("Web Images Groups YOURS_HERE News Froogle Local") that links to a
nonexistent page, and zap the error page that comes back and replace
it with your own content. You'll need to set document.body.innerHTML
= 'FULL_HTML_BODY', document.title = 'NEW_TITLE', and remove
everything in document.stylesheets and replace them with your own.
There may be an easier way to do this; that's all I had come up with
during my experimenting. If you do a "Page Info" on the resulting
page, you'll see that it originally returned a 404, but otherwise the
effect is virtually seamless, and causes quite a double-take when
people first see it. Of course, the server will be registering 404s
on that page and the publisher may take notice, but really there's not
much they can do to about it (modulo previously reported bugs with
window.setEventListener = null).
More information about the Greasemonkey