Merge pull request #8279 from hashicorp/b-ui/remove-safari-special-case

UI: Fix monitor in Safari
This commit is contained in:
Michael Lange 2020-06-25 09:22:39 -07:00 committed by GitHub
commit 683a4c81ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 12 deletions

View File

@ -89,16 +89,5 @@ export default class StreamLogger extends EmberObject.extend(AbstractLogger) {
}
StreamLogger.reopenClass({
isSupported: !!window.ReadableStream && !isSafari(),
isSupported: !!window.ReadableStream,
});
// 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;
}