Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RIP ActiveXObject #1630

Merged
merged 4 commits into from
Jun 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -63,36 +63,11 @@ request.getXHR = () => {
if (
root.XMLHttpRequest &&
(!root.location ||
root.location.protocol !== 'file:' ||
!root.ActiveXObject)
root.location.protocol !== 'file:')
) {
jimmywarting marked this conversation as resolved.
Show resolved Hide resolved
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');
};