Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle DOM elements for service worker #506

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
14 changes: 8 additions & 6 deletions lib/browser/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

import buffer from 'buffer';
import process from 'process';

// Workaround to get mqtt-js working with Webpack 5
if (window) {
(window as any).Buffer = buffer.Buffer;
(window as any).process = process;
// NodeJS global shim workaround for Angular
(window as any).global = window;
if (typeof self !== 'undefined') {
(self as any).Buffer = buffer.Buffer;
(self as any).process = process;

if (self.window) {
// NodeJS global shim workaround for Angular
(self.window as any).global = window
}
}

export {};
Loading