diff --git a/package.json b/package.json index 45dc583..0254b90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wxhccc/es-util", - "version": "2.0.1", + "version": "2.0.2", "description": "A library that contains some useful methods", "main": "dist/index.js", "module": "dist/index.esm.js", diff --git a/src/page-communicate.ts b/src/page-communicate.ts index f6686bd..1435d7e 100644 --- a/src/page-communicate.ts +++ b/src/page-communicate.ts @@ -42,7 +42,7 @@ export function pageCommunicate(options?: PcConfigOptions) { const channelName = 'PAGE_COMMUNICATE_CHANNEL' - if (typeof BroadcastChannel !== undefined) { + if (typeof window.BroadcastChannel !== undefined) { bc = new BroadcastChannel(channelName) bc.addEventListener('message', onMessage) } else {