Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(fetch): correct chrome not able to load about://blank
Browse files Browse the repository at this point in the history
Closes #444
  • Loading branch information
mhevery committed Sep 30, 2016
1 parent 7a66237 commit 832baa0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,14 @@ const Zone: ZoneType = (function(global: any) {
if (NativePromise) {
patchThen(NativePromise);
if (typeof global['fetch'] !== 'undefined') {
const fetchPromise = global['fetch']('about:blank');
var fetchPromise: Promise<any>;
try {
// In MS Edge this throws
fetchPromise = global['fetch']();
} catch (e) {
// In Chrome this throws instead.
fetchPromise = global['fetch']('about:blank');
}
// ignore output to prevent error;
fetchPromise.then(() => null, () => null);
if (fetchPromise.constructor != NativePromise) {
Expand Down

0 comments on commit 832baa0

Please sign in to comment.