1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-18 01:20:05 +00:00

fix(*): use fetch polyfill in Firefox 60

This commit is contained in:
Krishna Acondy
2020-08-13 21:07:21 +01:00
parent 0ffa62fab4
commit 870cc0055b
2 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import * as e6p from "es6-promise"; import * as e6p from "es6-promise";
(e6p as any).polyfill(); (e6p as any).polyfill();
if (isIEorEDGE()) { if (isIEorEdgeOrFirefox60()) {
window.fetch = undefined as any; // ensure the polyfill runs window.fetch = undefined as any; // ensure the polyfill runs
} }
// tslint:disable-next-line // tslint:disable-next-line
@@ -31,7 +31,7 @@ import {
import { SASViyaApiClient } from "./SASViyaApiClient"; import { SASViyaApiClient } from "./SASViyaApiClient";
import { SAS9ApiClient } from "./SAS9ApiClient"; import { SAS9ApiClient } from "./SAS9ApiClient";
import { FileUploader } from "./FileUploader"; import { FileUploader } from "./FileUploader";
import { isIEorEDGE } from "./utils/isIeOrEdge"; import { isIEorEdgeOrFirefox60 } from "./utils/isIeOrEdge";
const defaultConfig: SASjsConfig = { const defaultConfig: SASjsConfig = {
serverUrl: "", serverUrl: "",

View File

@@ -1,6 +1,10 @@
export function isIEorEDGE() { export function isIEorEdgeOrFirefox60() {
const ua = window.navigator.userAgent; const ua = window.navigator.userAgent;
if (ua.indexOf("Firefox/60") > 0) {
return true;
}
const msie = ua.indexOf("MSIE "); const msie = ua.indexOf("MSIE ");
if (msie > 0) { if (msie > 0) {
// IE 10 or older => return version number // IE 10 or older => return version number