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 24, 2018
1 parent 672c6d9 commit 4ac1ec0
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 4ac1ec0

Please sign in to comment.