BJAX with Greasemonkey in Firefox and IE

You read about BJAX (Browser Extensions plus AJAX), the writter has put together a Greasemonkey script that demonstrates how to add a simple Ajax widget to a third party web page. The example isn't particularly useful -- a translucent box that floats over the google search page and displays the current weather, updated every minute, in […]

You read about BJAX (Browser Extensions plus AJAX), the writter has put together a Greasemonkey script that demonstrates how to add a simple Ajax widget to a third party web page. The example isn't particularly useful -- a translucent box that floats over the google search page and displays the current weather, updated every minute, in downtown Chicago -- but it does illustrate the basics of using GM_xmlhttpRequest as well as the pitfalls of writing Javascript that executes in the Greasemonkey sandbox. An article discussing an updated version that adds support for IE (using the Turnabout extension) and the ability to toggle the size of the widget can be found here.

If you want to do any serious development in this environment, of course, you'll want to port an Ajax framework across to use GM_xmlhttpRequest instead of XMLHttpRequest, and obey the other restrictions of the Greasemonkey sandbox.

ajaxian

BJAX with Greasemonkey in Firefox and IE