Skip to content

Commit 925ecf0

Browse files
author
Timothy Johnson
committed
Fixes #13
1 parent ada4ebb commit 925ecf0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dest/background.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const isChrome = typeof browser == 'undefined'
2+
13
const toolsPorts = new Map()
24
const pagePorts = new Map()
35

@@ -44,7 +46,12 @@ function handlePageMessage(msg, port) {
4446
}
4547

4648
function attachScript(tabId, changed) {
47-
if (!toolsPorts.has(tabId) || changed.status != 'loading') return
49+
if (
50+
!toolsPorts.has(tabId) ||
51+
changed.status != 'loading' ||
52+
(!isChrome && !changed.url)
53+
)
54+
return
4855

4956
toolsPorts.get(tabId).postMessage({ type: 'init' })
5057
chrome.tabs.executeScript(tabId, {

0 commit comments

Comments
 (0)