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:
23
src/utils/isIeOrEdge.ts
Normal file
23
src/utils/isIeOrEdge.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user