mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Fix #2352: update tri.contentLocation on navigation
I think 'forgetting that people navigate to web pages without changing tab' is probably the funniest root-cause of a bug we've had in a while.
This commit is contained in:
parent
db43b3a345
commit
1c4722f4db
1 changed files with 8 additions and 0 deletions
|
@ -79,6 +79,14 @@ browser.tabs.onActivated.addListener(ev => {
|
|||
}
|
||||
})
|
||||
})
|
||||
// Update on navigation too (but remember that sometimes people open tabs in the background :) )
|
||||
browser.webNavigation.onDOMContentLoaded.addListener(
|
||||
() => {
|
||||
browser.tabs.query({ currentWindow: true, active: true }).then(t => {
|
||||
(window as any).tri.contentLocation = new URL(t[0].url)
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
// Prevent Tridactyl from being updated while it is running in the hope of fixing #290
|
||||
browser.runtime.onUpdateAvailable.addListener(_ => undefined)
|
||||
|
|
Loading…
Add table
Reference in a new issue