Skip to content

Commit 4b1caf6

Browse files
committed
update the dispatch method
1 parent ab61949 commit 4b1caf6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dapp-example/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
})
2424

2525
// 监听Bytom插件加载成功事件
26-
document.addEventListener('chromeBytomLoaded', () => {
27-
console.log('chromeBytomLoaded')
26+
document.addEventListener('bytomLoaded', () => {
27+
console.log('bytomLoaded')
2828
bytom = window.bytom
2929
})
3030
</script>

src/content.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Content {
4545
// Dispatching the loaded event to the web application.
4646
isReady = true
4747

48+
document.dispatchEvent(new CustomEvent('bytomLoaded'))
4849
document.dispatchEvent(new CustomEvent('chromeBytomLoaded'))
4950
})
5051

0 commit comments

Comments
 (0)