Skip to content

Commit

Permalink
fix: 修复safari浏览器BroadcastChannel报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wxhccc committed Sep 13, 2022
1 parent d3476c9 commit dca8c16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/page-communicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit dca8c16

Please sign in to comment.