Archive

Monthly Archives: May 2011

While working on a Songbird extension, I found myself needing to debug some AJAX code. Songbird is built on the Mozilla application framework, and I haven’t yet figured out how to do this kind of debugging directly in the application, so I just ripped out the relevant code and put it into a tst.html file so I could debug it with Firebug in Firefox.

Of course, opening the file in Firefox using a file:// URL, the XMLHttpRequest falls foul of cross-scripting browser security measures, so the search was on for the magic bit of about:config that would allow it. I didn’t find it, but I did find this bit of Firefox Javascript voodoo:

netscape.security.PrivilegeManager.enablePrivilege(“UniversalXPConnect”);

Put this in your page, and it’ll pop up a window asking you whether to allow XSS for the page. It has a checkbox to remember your choice, so it only prompts you the first time. Perfect!

 

 

Advertisements
%d bloggers like this: