mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Autoclose the consent screen after user choice. Show consent screen only in FireFox
This commit is contained in:
parent
1c38137200
commit
2f5d425f34
|
@ -280,8 +280,10 @@ console.log('Extension started.');
|
||||||
|
|
||||||
const compareVersions = (a, b) => versionToInt(a) - versionToInt(b);
|
const compareVersions = (a, b) => versionToInt(a) - versionToInt(b);
|
||||||
|
|
||||||
|
const ifFirefox = navigator.userAgent.toLowerCase().includes('firefox');
|
||||||
|
|
||||||
let give;
|
let give;
|
||||||
const promise = new Promise((resolve) => {
|
const promise = !ifFirefox ? Promise.resolve() : new Promise((resolve) => {
|
||||||
give = resolve;
|
give = resolve;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -291,7 +293,7 @@ console.log('Extension started.');
|
||||||
give,
|
give,
|
||||||
},
|
},
|
||||||
platform: {
|
platform: {
|
||||||
ifFirefox: navigator.userAgent.toLowerCase().includes('firefox'),
|
ifFirefox,
|
||||||
},
|
},
|
||||||
version: {
|
version: {
|
||||||
ifMini: false,
|
ifMini: false,
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
chrome.runtime.getBackgroundPage( (backgroundPage) =>
|
||||||
backgroundPage.apis.errorHandlers.installListenersOn(
|
backgroundPage.apis.errorHandlers.installListenersOn(
|
||||||
window, 'CONSENT', () => {
|
window, 'CONSENT', () => {
|
||||||
agreeBtn.onclick = () =>
|
agreeBtn.onclick = () => {
|
||||||
backgroundPage.apis.consent.give();
|
backgroundPage.apis.consent.give();
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
rejectBtn.onclick = () =>
|
rejectBtn.onclick = () =>
|
||||||
chrome.management.uninstallSelf();
|
chrome.management.uninstallSelf();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user