Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Add firefoxOs suport for xhr #7514

Closed
wants to merge 2 commits into from
Closed
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
19 changes: 18 additions & 1 deletion src/ng/httpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ function createXhr(method) {
!window.XMLHttpRequest)) {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} else if (window.XMLHttpRequest) {
return new window.XMLHttpRequest();
if(isFirefoxOs()){
return new window.XMLHttpRequest({mozSystem:true});
} else {
return new window.XMLHttpRequest();
}
}

throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest.");
Expand Down Expand Up @@ -193,3 +197,16 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
return callback;
}
}

/**
* Return the information if the device is a FirefoxOS mobile phone.
* Test if the appCodeName is Mozilla and search if user-agent has mobile and
* don´t have android
*/
function isFirefoxOs() {
if ( navigator.appCodeName === 'Mozilla' && navigator.userAgent.search('Mobile') !== -1 && navigator.userAgent.search('Android')<0){
return true;
} else {
return false;
}
}