-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.ts
More file actions
30 lines (27 loc) · 1.09 KB
/
Copy pathbackground.ts
File metadata and controls
30 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
chrome.runtime.onInstalled.addListener(() => {
/* chrome.storage.sync.get({ count: 0 } as IOptions, ({ count }: IOptions) => {
console.log(count);
}); */
});
chrome.webNavigation.onCompleted.addListener(frame => {
// extension-specific styles
chrome.scripting.insertCSS({
target: { tabId: frame.tabId },
files: ["build/content_script.css"]
});
// page augmentations before insert a extension's content-script
chrome.scripting.insertCSS({
target: { tabId: frame.tabId },
css: ".repos-pr-details-page{position:relative;}"
});
// logic that will handle buttons rendering
chrome.scripting.executeScript({
target: { tabId: frame.tabId },
files: ["build/content_script.js"]
});
}, { url: [
{ urlMatches: "https?:\/\/(dev\.azure\.com){1}[\/\w\d\sA-Za-z0-9-_]*(pullrequest\/[0-9])+" },
{ urlMatches: "https?:\/\/(github\.com){1}[\/\w\d\sA-Za-z0-9-_]*(pull\/[0-9])+" },
{ urlMatches: "https?:\/\/(gitlab\.com){1}[\/\w\d\sA-Za-z0-9-_]*(merge_requests\/[0-9])+" },
{ urlMatches: "https?:\/\/(bitbucket\.org){1}[\/\w\d\sA-Za-z0-9-_]*(pull-requests\/[0-9])+" }
] });