User talk:Joeytwiddle

From GreaseSpot Wiki
Jump to navigationJump to search

Further thoughts on Userscripts Toolbar

Greasemonkey gave userscripts all the powers that Bookmarklets were lacking, persistent state, auto-execute and cross-domain XHR, hooray! But sometimes I feel that GM has an extra layer of hoops to jump through. Bookmarklets are quick and flexible. You don't have to specify which sites a Bookmarklet should load on. You can be browsing on any website and invoke the Bookmarklet you need when you need it. (The current GM policy is that users must define which URLs a userscript should run on, before loading the page. Inconvenient!)

I sometimes dream about a merger of the two technologies, and in my head it appears like this:

  • On every page I surf, Greasemonkey loads up my "Userscript bar". Initially this is just a little icon (maybe a star or a monkey face) which sits in the corner of the page. When I click it or mouseover, the bar unfolds.
  • Sitting in my userscript bar are all my favourite userscripts. They each have an icon. The ones which won't work on this page are greyed out or hidden. But basically I can click on the icon of a userscript when I want to use it.
  • I would imagine these "scriptlets" would meet some standard which would allow them to:
    • Maybe run some things at startup:
      • Maybe the user previously re-arranged this page using this scriptlet, and they want the changes applied on all visits.
      • The scriptlet might show meta-info about a page. It could start loading this in the background, and update its icon to present the results summary, or the full summary when clicked.
      • The scriptlet can take a look at what is on the page, and can disable itself if it cannot be of use here.
    • Have a default action when invoked by user click, or a standardized menu drop-down if the scriptlet has multiple features.
    • Provide an Icon.
    • Still have the ability to respond to @include and @exclude metas, but these will be used slightly less often.
    • Provide an unload hook as described elsewhere. If we have finished using a scriptlet, or it's simply not doing the right thing, we invoke this to unload the script and undo its changes.

What would this achieve?

  • I suggested a richer UI. We can interact with all our Userscripts in a fast way. They can present us information through their icon and tooltip. We can just occasionally invoke a rare script that is only useful in odd moments. If it works, we could click [x] Always run on this page or [x] Always run on this site.
  • I am suggesting these userscripts become more like mini-apps. Web helper tools, but cheaper than installing a Firefox extension. If you want, think of it as "My Mashup Toolbar".
  • Have you other Linux users noticed how website GUIs running inside the browser window are actually faster than Firefox's own chrome/xul GUI with native Gnome/GTK?! Crazy but true.