1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

fix(*): use fetch polyfill in IE and Edge

This commit is contained in:
Krishna Acondy
2020-08-13 20:53:27 +01:00
parent b4c7868fb6
commit 0ffa62fab4
2 changed files with 33 additions and 3 deletions

23
src/utils/isIeOrEdge.ts Normal file
View File

@@ -0,0 +1,23 @@
export function isIEorEDGE() {
const ua = window.navigator.userAgent;
const msie = ua.indexOf("MSIE ");
if (msie > 0) {
// IE 10 or older => return version number
return true;
}
const trident = ua.indexOf("Trident/");
if (trident > 0) {
return true;
}
const edge = ua.indexOf("Edge/");
if (edge > 0) {
// Edge (IE 12+) => return version number
return true;
}
// other browser
return false;
}