mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-10 19:46:34 +03:00
Start adding shortcut support
This commit is contained in:
parent
3d72acc6dd
commit
f4f95c0763
|
@ -230,7 +230,7 @@
|
||||||
);
|
);
|
||||||
return (ifUnattended
|
return (ifUnattended
|
||||||
? tryPromiseSeveralTimesAsync(tryAllUrlsAsync, [20, 40, 60])
|
? tryPromiseSeveralTimesAsync(tryAllUrlsAsync, [20, 40, 60])
|
||||||
: tryAllUrlsAsync()
|
: tryAllUrlsAsync()
|
||||||
).catch(
|
).catch(
|
||||||
(err) => Promise.reject(clarify(
|
(err) => Promise.reject(clarify(
|
||||||
err,
|
err,
|
||||||
|
|
|
@ -1,7 +1,19 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
chrome.commands.onCommand.addListener((command) => {
|
chrome.commands.onCommand.addListener(async (command) => {
|
||||||
if (command === 'toggle-pac-script') {
|
if (command === 'toggle-pac-script') {
|
||||||
console.log("Toggling PAC-script!");
|
console.log("Toggling PAC-script!");
|
||||||
|
const pacKey = window.apis.antiCensorRu.getCurrentPacProviderKey();
|
||||||
|
if (!pacKey) {
|
||||||
|
let antiCensorRu = await window.utils.promisedLocalStorage
|
||||||
|
.get('antiCensorRu');
|
||||||
|
const oldKey = antiCensorRu._currentPacProviderKey;
|
||||||
|
console.log('OLD KEY:', oldKey);
|
||||||
|
if (oldKey) {
|
||||||
|
window.apis.antiCensorRu.installPacAsync(oldKey, cb);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.apis.antiCensorRu.clearPacAsync();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user