-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackground.js
More file actions
19 lines (17 loc) · 739 Bytes
/
background.js
File metadata and controls
19 lines (17 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Quando estiver instalando/atualizando:
chrome.runtime.onInstalled.addListener(function() {
// Remover as regras de mudança de página:
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
// Para adicionar a regra abaixo:
chrome.declarativeContent.onPageChanged.addRules([{
// Se:
conditions: [
new chrome.declarativeContent.PageStateMatcher({
// A url da página conter:
pageUrl: { urlContains: 'https://ca.bbcollab.com/collab/ui/session/'}
}) ],
// Nesse caso, mostramos a Page Action da extensão:
actions: [ new chrome.declarativeContent.ShowPageAction() ]
}]);
});
});