Skip to content

Commit febbc71

Browse files
committed
Add declarative script injection
1 parent 3559cd3 commit febbc71

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

js/background.js

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

3+
// Declarative content script injection doesn't work on push state (i.e. when
4+
// navigating from trello.com/username/boards to a specific board page), so we
5+
// re-inject content scripts programmatically onHistoryStateUpdated.
36
chrome.webNavigation.onHistoryStateUpdated.addListener(function(details) {
47
// Match Trello board pages only
58
const match = details.url.includes(boardUrl);

manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"js/background.js"
1414
]
1515
},
16+
"content_scripts": [{
17+
"matches": ["*://trello.com/b/*"],
18+
"css": ["css/layout.css"],
19+
"js": ["js/init.js"]
20+
}],
1621
"permissions": [
1722
"*://trello.com/b/*",
1823
"declarativeContent",

0 commit comments

Comments
 (0)