Skip to content

Commit a1c19bf

Browse files
committed
move to manifest 3
1 parent 5b2a9a4 commit a1c19bf

2 files changed

Lines changed: 48 additions & 23 deletions

File tree

manifest.json

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
{
2-
"page_action": {
3-
"default_icon": "icons/128.png",
4-
"default_popup": "scripts/popup.html",
5-
"default_title": "show the Openconnect cookie/cmd line"
6-
},
7-
"description": "easily extract and display the VPN cookie to use with openconnect and Cisco AnyConnect Servers.",
8-
"icons": {
9-
"128": "icons/128.png",
10-
"26": "icons/26.png",
11-
"32": "icons/32.png",
12-
"48": "icons/48.png"
13-
},
14-
"manifest_version": 2,
15-
"name": "OpenAnyconnect Cookie Tray (Uni Lincoln)",
16-
"offline_enabled": false,
17-
"permissions": ["declarativeContent", "activeTab", "cookies", "https://remote.lincoln.ac.uk/*" ],
18-
"short_name": "cookietray",
19-
"version": "0.0.2",
20-
"background": {
21-
"scripts": ["scripts/background.js"],
22-
"persistent": false
23-
}
24-
}
2+
"description": "easily extract and display the VPN cookie to use with openconnect and Cisco AnyConnect Servers.",
3+
"icons": {
4+
"128": "icons/128.png",
5+
"26": "icons/26.png",
6+
"32": "icons/32.png",
7+
"48": "icons/48.png"
8+
},
9+
"manifest_version": 3,
10+
"name": "OpenAnyconnect Cookie Tray (Uni Lincoln)",
11+
"offline_enabled": false,
12+
"permissions": [
13+
"declarativeContent",
14+
"activeTab",
15+
"cookies"
16+
],
17+
"short_name": "cookietray",
18+
"version": "0.1.0",
19+
"background": {
20+
"service_worker": "service_worker.js"
21+
},
22+
"action": {
23+
"default_icon": "icons/128.png",
24+
"default_popup": "scripts/popup.html",
25+
"default_title": "show the Openconnect cookie/cmd line"
26+
},
27+
"content_security_policy": {},
28+
"host_permissions": [
29+
"https://remote.lincoln.ac.uk/*"
30+
]
31+
}

service_worker.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
chrome.runtime.onInstalled.addListener(function() {
2+
// Replace all rules ...
3+
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
4+
// With a new rule ...
5+
chrome.declarativeContent.onPageChanged.addRules([
6+
{
7+
// That fires when a page's URL contains a 'g' ...
8+
conditions: [
9+
new chrome.declarativeContent.PageStateMatcher({
10+
pageUrl: { urlContains: 'https://remote.lincoln.ac.uk' },
11+
})
12+
],
13+
// And shows the extension's page action.
14+
actions: [ new chrome.declarativeContent.ShowPageAction() ]
15+
}
16+
]);
17+
});
18+
});

0 commit comments

Comments
 (0)