#316: this time realy fixed Edge

This commit is contained in:
SleepWalker 2017-04-12 21:34:12 +03:00
parent a37a171ff8
commit 7a30a7e37f
2 changed files with 13 additions and 14 deletions

View File

@ -6,9 +6,21 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<% if (htmlWebpackPlugin.files.favicon) { %>
<link rel="shortcut icon" href="<%= htmlWebpackPlugin.files.favicon %>">
<% } %>
<script>
if (/Edge\/(must die)?/.test(navigator.userAgent)) {
// Edge has a broken fetch implementation, so forcing the polyfill
// https://www.reddit.com/r/webdev/comments/57ii4f/psa_edge_14_ships_a_broken_windowfetch/
// https://github.com/aurelia/fetch-client/issues/81
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9370062/
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7773267/
delete window.fetch;
}
</script>
</head>
<body>

View File

@ -1,20 +1,7 @@
import 'babel-polyfill';
import 'whatwg-fetch';
import { shim as shimPromiseFinaly } from 'promise.prototype.finally';
const isEdge = /Edge\//.test(navigator.userAgent);
if (isEdge) {
// Edge has a broken fetch implementation, so forcing the polyfill
// https://www.reddit.com/r/webdev/comments/57ii4f/psa_edge_14_ships_a_broken_windowfetch/
// https://github.com/aurelia/fetch-client/issues/81
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9370062/
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7773267/
Reflect.deleteProperty(window, 'fetch');
}
// using require instead of import, because import is hoisting to the top
// so that our fetch hack for Edge won't work
require('whatwg-fetch');
shimPromiseFinaly();
// allow :active styles in mobile Safary