Skip navigation.

web:config

tips and tricks for the interwebs

Posts tagged with "plugsome toolbar"

Plugsome Toolbar

, , , ...

I present you, right from xErath labs, beign these a two year old laptop (which works just fine), the "Plugsome Toolbar" user javascript. It's fairly simple to use, and very useful.
In the screenshot that follows you can have an idea of what it does::cool:



This script is an utility that add a small toolbar to plugins in webpages.:raider:
The toolbar by default has 3 buttons:
  • the 1st button is a Reload button which reload the plugin content
  • the 2nd button is a link to the external file that the plugin loaded. Somefiles might get special treatment, like in youtube. Instead of linking to youtube's media player swf, the script links to the video file. Click this link to save the file.
  • the 3rd button is a X which if clicked closes the toolbar, and if double-clicked removes the toolbar and plugin from the page. The space that the plugin occupied is preserved though.
The toolbar is dimmed by default, and it'll highlight when you hover it.
If the toolbar is attached to a Flash file, then you get two extra buttons: a play and a pause button. Note however, that play and pause might not pause/resume plyback in all flash files. This is due to the file's internal structure, and the way content is layed out in the Flash's timeline.

Download link:
xerath-plugsome-toolbar.js
Further updates will be annouced, the link above will point always to the latest version.

Technical details
The script applies different treatment to differents objects in different websites, when returning the link of the file feed to the plugin.
The script already support youtube.
To add your custom behavior for a specific website, the user script exports a small interface.

All functions and variables are grouped in the opera.PlugsomeToolbar object.
The object has the following properties:
  • version - script version
  • URLHandlers - an object with host names and custom functions to apply to a html OBJECT or EMBED to have the link that is available in the toolbar.
  • URLHandlerFallback - a fallback function that should be called when custom functions in URLHandlers require to work asynchronously, but fail to retrieve the file url
  • AllToolbars - an array with all the instantiated toolbars in the current page.
The object looks like this:
a.PlugsomeToolbar = {
    version: '1.0',
    URLHandlers: {'a':...}
    URLHandlerFallback: function(){...},
    AllToolbars: [...]
};

To code your own website rule, do something like this:
opera.PlugsomeToolbar.URLHandlers['.youtube.']=function(object, link){
    var fv = object.getAttribute('flashvars');
    if( fv ){
        /* ... */
        link.href = 'http://www.youtube.com/.....';
        return true;
    };
};
You can, and should place it in another file, because that way you can easily upgrade Plugsome Toolbar without loosing functionality.
The functions in URLHandlers receive 2 arguments, the plugin and the toolbar link to fill in the href. Each function returns true or false, respectively, in case of success or fail. The script, for each plugin, loops through all rules and aborts when one returns true, meaning that the link is known.



cow You might find the name "Plugsome Toolbar" familiar. The original one was invented to feed hype for a specific piece of software, when others did the same thing that the former advertised.
But we're not here to talk about Firefox,... whoops, I said it... :whistle:

EDIT (2008-June-11)
New update, version 1.0.2.

Changelog:
  • Option to show toolbar when plugins are disabled
  • Added Quicktime and windows media player controls toolbar
Note: the quicktime controls may not work in. It seems quicktime scripting is broken in Opera. But the work is done, until Opera get fixed.
Download Opera, the fastest and most secure browser