Skip to content

Commit a51cad0

Browse files
committed
Back to using onHistoryStateUpdated
I think this is only triggered on trello.com pages, whereas the tabs API was overzealously triggering on every page.
1 parent 6ee4120 commit a51cad0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const boardUrl = 'trello.com/b/';
22

3-
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
3+
chrome.webNavigation.onHistoryStateUpdated.addListener(function(details) {
44
// Match Trello board pages only
5-
const match = tab.url.includes(boardUrl);
5+
const match = details.url.includes(boardUrl);
66

77
// Setup page for layout changes and show page action
88
if (match) {

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"permissions": [
1717
"*://trello.com/b/*",
1818
"declarativeContent",
19-
"tabs",
20-
"storage"
19+
"storage",
20+
"webNavigation"
2121
],
2222
"web_accessible_resources": [
2323
"css/layout.css"

0 commit comments

Comments
 (0)