JustForex
Loading recent posts...

Nov 27, 2011

Web Apps Can Modify the Firefox Context Menu via HTML5




HTML5 goes beyond just the <video>, <audio> or the <canvas> tags. And there's more to it than just the big technical features, drag and drop, filesystem support. What makes it really useful are the little things.

For example, HTML5 context menus which enable a web app to request that the browser add one or more custom entries to the right-click menu.

However, as with many other HTML5 specifications, most browsers don't support custom context menus.

In fact, Mozilla is the only one to add support and this just happened in the recently launched Firefox 8. At this time, Firefox is the only browser to support the feature.

"You may not know it, but the HTML5 specifications go beyond what we put in the pages and also define how parts of the browser should become available to developers with HTML, CSS and JavaScript," Mozilla's HTML5 evangelist Chris Heilmann wrote.

"One of these parts of the specs are context menus, or 'right click menus.' Using HTML5 and a menu element you can add new options to these without having to write a browser add-on," he said.

Since this is such a new feature, you're probably not going to encounter it on the web any time soon. But if you're running Firefox 8 or a newer version, you can check out the demo page Mozilla has set up to see the functionality in action.

And, if you're a developer, Mozilla is also providing all of the code necessary to create your own custom menus. Since this is a standard HTML feature, actually creating menu entries is quite simple.

As for why you'd want custom context menu entries, the possibilities are endless.

Just imagine all of the things you can do with a context menu in a desktop app and then remember how many times you right-clicked in a web app, like Grooveshark, expecting to see a context menu relevant to the item you selected. Of course, there's also the risk that the feature will be abused.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes
`