Skip to content

Commit

Permalink
Use typeof xhr to test which one to use
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolverson committed Feb 10, 2022
1 parent 5bf454c commit 69427ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Affjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

exports._ajax = function () {
var platformSpecific = { };
if (typeof module !== "undefined" && module.require && !(typeof process !== "undefined" && process.versions["electron"])) {
// We are on node.js
if (typeof XMLHttpRequest === "undefined") {
// We are on node.js or electron main script
platformSpecific.newXHR = function () {
var XHR = module.require("xhr2");
return new XHR();
Expand Down

0 comments on commit 69427ed

Please sign in to comment.