mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-23 18:03:44 +03:00
Open howto when extension needs access to private windows
This commit is contained in:
parent
99a4ff9d24
commit
73485e8be4
|
@ -232,6 +232,15 @@ console.log('Extension started.');
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
openAndFocus(url) {
|
||||||
|
|
||||||
|
chrome.tabs.create(
|
||||||
|
{url: url},
|
||||||
|
(tab) => chrome.windows.update(tab.windowId, {focused: true})
|
||||||
|
);
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const max = 2**16;
|
const max = 2**16;
|
||||||
|
|
|
@ -53,15 +53,6 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openAndFocus = function openAndFocus(url) {
|
|
||||||
|
|
||||||
chrome.tabs.create(
|
|
||||||
{url: url},
|
|
||||||
(tab) => chrome.windows.update(tab.windowId, {focused: true})
|
|
||||||
);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const ifPrefix = 'if-on-';
|
const ifPrefix = 'if-on-';
|
||||||
const extName = chrome.runtime.getManifest().name;
|
const extName = chrome.runtime.getManifest().name;
|
||||||
const extVersion = window.apis.version.build;
|
const extVersion = window.apis.version.build;
|
||||||
|
@ -75,7 +66,7 @@
|
||||||
const errors = err ? {[type]: err} : this.idToError;
|
const errors = err ? {[type]: err} : this.idToError;
|
||||||
const json = JSON.stringify(errors, errorJsonReplacer, 0);
|
const json = JSON.stringify(errors, errorJsonReplacer, 0);
|
||||||
|
|
||||||
openAndFocus(
|
window.utils.openAndFocus(
|
||||||
'https://rebrand.ly/ac-error/?json=' + encodeURIComponent(json) +
|
'https://rebrand.ly/ac-error/?json=' + encodeURIComponent(json) +
|
||||||
(type ? '&type=' + encodeURIComponent(type) : '') +
|
(type ? '&type=' + encodeURIComponent(type) : '') +
|
||||||
'&version=' + chrome.runtime.getManifest().version +
|
'&version=' + chrome.runtime.getManifest().version +
|
||||||
|
@ -242,7 +233,7 @@
|
||||||
|
|
||||||
chrome.notifications.clear(notId);
|
chrome.notifications.clear(notId);
|
||||||
if(notId === 'no-control') {
|
if(notId === 'no-control') {
|
||||||
return openAndFocus(
|
return window.utils.openAndFocus(
|
||||||
window.utils.messages.searchSettingsForUrl('proxy')
|
window.utils.messages.searchSettingsForUrl('proxy')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,14 @@
|
||||||
chrome.proxy.settings.set( { value: config }, chromified((err) => {
|
chrome.proxy.settings.set( { value: config }, chromified((err) => {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
if (err.message === 'proxy.settings requires private browsing permission.') {
|
||||||
|
window.utils.openAndFocus('https://rebrand.ly/ac-allow-private-windows');
|
||||||
|
clarifyThen(
|
||||||
|
chrome.i18n.getMessage('AllowExtensionToRunInPrivateWindows'),
|
||||||
|
cb,
|
||||||
|
)(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
handlers.updateControlState( () => {
|
handlers.updateControlState( () => {
|
||||||
|
|
|
@ -136,5 +136,8 @@
|
||||||
},
|
},
|
||||||
"noOwnProxiesError": {
|
"noOwnProxiesError": {
|
||||||
"message": "Proxying of OWN sites is possible only via OWN proxies. No own proxies found that satisfy your requirements."
|
"message": "Proxying of OWN sites is possible only via OWN proxies. No own proxies found that satisfy your requirements."
|
||||||
|
},
|
||||||
|
"AllowExtensionToRunInPrivateWindows": {
|
||||||
|
"message": "For the extension to work it is required to allow it to run in private windows, see <a href='https://rebrand.ly/ac-allow-private-windows'>howto</a>."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,5 +136,8 @@
|
||||||
},
|
},
|
||||||
"noOwnProxiesError": {
|
"noOwnProxiesError": {
|
||||||
"message": "Проксировать СВОИ сайты можно только при наличии СВОИХ прокси. Нет своих прокси, удовлетворяющих вашим требованиям."
|
"message": "Проксировать СВОИ сайты можно только при наличии СВОИХ прокси. Нет своих прокси, удовлетворяющих вашим требованиям."
|
||||||
|
},
|
||||||
|
"AllowExtensionToRunInPrivateWindows": {
|
||||||
|
"message": "Для работы расширения необходимо разрешить запуск в приватных окнах, см. <a href='https://rebrand.ly/ac-allow-private-windows'>инструкции</a>."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user