mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2025-01-31 03:34:08 +03:00
Start adding shortcut support
This commit is contained in:
parent
3d72acc6dd
commit
f4f95c0763
|
@ -230,7 +230,7 @@
|
|||
);
|
||||
return (ifUnattended
|
||||
? tryPromiseSeveralTimesAsync(tryAllUrlsAsync, [20, 40, 60])
|
||||
: tryAllUrlsAsync()
|
||||
: tryAllUrlsAsync()
|
||||
).catch(
|
||||
(err) => Promise.reject(clarify(
|
||||
err,
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
chrome.commands.onCommand.addListener((command) => {
|
||||
chrome.commands.onCommand.addListener(async (command) => {
|
||||
if (command === 'toggle-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