XMLHttpRequest is not defined, in a chrome extension options page

14,964

To construct an XHR object you use new XMLHttpRequest();.

getXMLHttpRequest is not a standard function.

I saw here that getXMLHttpRequests are a problem…

The question at the other end of the link doesn't use a function with a name starting with get.

Share:
14,964
little-dude
Author by

little-dude

Updated on June 04, 2022

Comments

  • little-dude
    little-dude almost 2 years

    I'm trying to make an XMLHttpRequest in the options page of an extension. In my options.js file I simply have the following code :

    if (window.XMLHttpRequest){
            var xhr = new getXMLHttpRequest();
    }
    

    But I have this error in the console

    Uncaught ReferenceError: getXMLHttpRequest is not defined

    I saw here that getXMLHttpRequests are a problem for hosted apps, but in this case, it's a simple extension, so I don't understand.