Skip to content

Commit 002b77b

Browse files
committed
Adding browser_specific_settings entry to the manifest; related to #222
1 parent f608eb9 commit 002b77b

File tree

3 files changed

+42
-37
lines changed

3 files changed

+42
-37
lines changed

v3/context.js

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
1-
const context = () => {
1+
const context = async () => {
22
if (context.ran) {
33
return;
44
}
55
context.ran = true;
66

7-
chrome.storage.local.get({
7+
const prefs = await chrome.storage.local.get({
88
'mode': 'blacklist'
9-
}, prefs => {
10-
// we do not support custom mode on m3 anymore
11-
chrome.contextMenus.create({
12-
id: 'blacklist',
13-
title: 'Switch to "black-list" mode',
14-
contexts: ['action'],
15-
type: 'radio',
16-
checked: prefs.mode === 'blacklist'
17-
}, () => chrome.runtime.lastError);
18-
chrome.contextMenus.create({
19-
id: 'whitelist',
20-
title: 'Switch to "white-list" mode',
21-
contexts: ['action'],
22-
type: 'radio',
23-
checked: prefs.mode === 'whitelist'
24-
}, () => chrome.runtime.lastError);
25-
chrome.contextMenus.create({
26-
id: 'custom',
27-
title: 'Switch to "custom" mode',
28-
contexts: ['action'],
29-
type: 'radio',
30-
checked: prefs.mode === 'custom'
31-
}, () => chrome.runtime.lastError);
32-
33-
chrome.contextMenus.create({
34-
id: 'pause-tab',
35-
title: 'Pause on This Tab',
36-
contexts: ['action']
37-
}, () => chrome.runtime.lastError);
38-
chrome.contextMenus.create({
39-
id: 'resume-tab',
40-
title: 'Resume on This Tab',
41-
contexts: ['action']
42-
}, () => chrome.runtime.lastError);
439
});
10+
// we do not support custom mode on m3 anymore
11+
chrome.contextMenus.create({
12+
id: 'blacklist',
13+
title: 'Switch to "black-list" mode',
14+
contexts: ['action'],
15+
type: 'radio',
16+
checked: prefs.mode === 'blacklist'
17+
}, () => chrome.runtime.lastError);
18+
chrome.contextMenus.create({
19+
id: 'whitelist',
20+
title: 'Switch to "white-list" mode',
21+
contexts: ['action'],
22+
type: 'radio',
23+
checked: prefs.mode === 'whitelist'
24+
}, () => chrome.runtime.lastError);
25+
chrome.contextMenus.create({
26+
id: 'custom',
27+
title: 'Switch to "custom" mode',
28+
contexts: ['action'],
29+
type: 'radio',
30+
checked: prefs.mode === 'custom'
31+
}, () => chrome.runtime.lastError);
32+
33+
chrome.contextMenus.create({
34+
id: 'pause-tab',
35+
title: 'Pause on This Tab',
36+
contexts: ['action']
37+
}, () => chrome.runtime.lastError);
38+
chrome.contextMenus.create({
39+
id: 'resume-tab',
40+
title: 'Resume on This Tab',
41+
contexts: ['action']
42+
}, () => chrome.runtime.lastError);
4443
};
4544

4645
chrome.contextMenus.onClicked.addListener((info, tab) => {

v3/data/options/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010
<div class="mode">
1111
<input type="radio" name="mode" value="blacklist" id="mode-blacklist">
12-
<label for="mode-blacklist"><h1><a data-href="faq14" data-localize="blackListMode">Black-List Mode</a></h1></label>
12+
<label for="mode-blacklist"><h1><a data-href="faq14" data-localize="blackListMode" target="_blank">Black-List Mode</a></h1></label>
1313
<span id="toggle-blacklist-desc" data-localize="description">Description</span>
1414
</div>
1515
<p for="toggle-blacklist-desc" class="note hidden" data-localize="blackListModeDescription">Apply the custom user-agent string to all tabs except the tabs with the following top-level hostnames (comma-separated list of hostnames). Note that even if a window-based user-agent string is set from the toolbar popup, your browser's default user-agent string is used.</p>

v3/manifest.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,11 @@
4747
"_execute_action": {
4848
"description": "Execute Action"
4949
}
50+
},
51+
"browser_specific_settings": {
52+
"gecko": {
53+
"id": "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}",
54+
"strict_min_version": "132.0"
55+
}
5056
}
5157
}

0 commit comments

Comments
 (0)