[Greasemonkey] GM_xmlHttpRequest question

Julien Couvreur julien.couvreur at gmail.com
Thu Sep 1 13:14:43 EDT 2005


I'm troubleshooting a webpage that uses XMLHttpRequest. So I copied
and opened it locally, using a "file://" path.
Now, the XHR request fails because of Firefox's security restriction.
So, I wrote a user script to temporarily lend my page the unrestricted
GM_xmlHttpRequest ability. The script is copied below.

But for some reason, even though my webpage is now calling the
injected/leaked GM_xmlHttpRequest API, I'm still getting "Permission
denied to call method XMLHttpRequest" errors...

What am I missing?


// ==UserScript==
// @name           XmlHttpRequest - Bypass Security
// @namespace   http://blog.monstuff.com/archives/cat_greasemonkey.html
// @description    Helps bypassing the "same domain" policy, during development.
// @include        file://*
// ==/UserScript==

window.setAttribute("GM_xmlhttpRequest", GM_xmlhttpRequest);
document.title += " - Unsecure XMLHttpRequest";

More information about the Greasemonkey mailing list