I get a ReferenceError in the following usercript code:
// ==UserScript== // @name ... // @namespace ... // @description ... // @include ... // @grant GM_xmlhttpRequest // ==/UserScript== console.log(GM_info); try { console.log(GM_xmlhttpRequest({ method: "GET", url: "http://google.ca/", synchronous: true }).readyState); } catch (e) { console.log(e); } ...
It first logs GM_info successfully, then writes a ReferenceError. (I am using Firefox / Firebug.)
ReferenceError: GM_xmlhttpRequest not defined
Why am I getting this error?
Kendall frey
source share