Skip to content

Commit

Permalink
The stream logger should not be supported in Safari
Browse files Browse the repository at this point in the history
Not until the bugs around https are worked out.
  • Loading branch information
DingoEatingFuzz committed May 25, 2018
1 parent ab49b7a commit 65adc38
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ui/app/utils/classes/stream-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,16 @@ export default EmberObject.extend(AbstractLogger, {
}
}),
}).reopenClass({
isSupported: !!window.ReadableStream,
isSupported: !!window.ReadableStream && !isSafari(),
});

// Fetch streaming doesn't work in Safari yet despite all the primitives being in place.
// Bug: https://bugs.webkit.org/show_bug.cgi?id=185924
// Until this is fixed, Safari needs to be explicitly targeted for poll-based logging.
function isSafari() {
const oldSafariTest = /constructor/i.test(window.HTMLElement);
const newSafariTest = (function(p) {
return p.toString() === '[object SafariRemoteNotification]';
})(!window['safari'] || (typeof window.safari !== 'undefined' && window.safari.pushNotification));
return oldSafariTest || newSafariTest;
}

0 comments on commit 65adc38

Please sign in to comment.