Skip to content

Commit

Permalink
Merge pull request #1630 from jimmywarting/remove-old-hacks
Browse files Browse the repository at this point in the history
RIP ActiveXObject
  • Loading branch information
titanism committed Jun 1, 2022
2 parents 9c5966e + 764412a commit 5c8fb1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -133,4 +133,4 @@
"test-http2": "npm run build && npm run lint && make test-node-http2"
},
"unpkg": "dist/superagent.min.js"
}
}
27 changes: 1 addition & 26 deletions src/client.js
Expand Up @@ -63,36 +63,11 @@ request.getXHR = () => {
if (
root.XMLHttpRequest &&
(!root.location ||
root.location.protocol !== 'file:' ||
!root.ActiveXObject)
root.location.protocol !== 'file:')
) {
return new XMLHttpRequest();
}

try {
return new ActiveXObject('Microsoft.XMLHTTP');
} catch {
/**/
}

try {
return new ActiveXObject('Msxml2.XMLHTTP.6.0');
} catch {
/**/
}

try {
return new ActiveXObject('Msxml2.XMLHTTP.3.0');
} catch {
/**/
}

try {
return new ActiveXObject('Msxml2.XMLHTTP');
} catch {
/**/
}

throw new Error('Browser-only version of superagent could not find XHR');
};

Expand Down

0 comments on commit 5c8fb1e

Please sign in to comment.