mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-20 01:12:38 +01:00
[mv3] Fix reflecting proper state when denied
This commit is contained in:
parent
fa07a90a53
commit
a47484bc33
@ -227,11 +227,19 @@ async function onOmnipotenceChanged(ev) {
|
||||
origins: [ '<all_urls>' ]
|
||||
});
|
||||
if ( newState === oldState ) { return; }
|
||||
|
||||
let actualState;
|
||||
if ( newState ) {
|
||||
browser.permissions.request({ origins: [ '<all_urls>' ] });
|
||||
actualState = await browser.permissions.request({
|
||||
origins: [ '<all_urls>' ]
|
||||
});
|
||||
} else {
|
||||
browser.permissions.remove({ origins: [ '<all_urls>' ] });
|
||||
actualState = await browser.permissions.remove({
|
||||
origins: [ '<all_urls>' ]
|
||||
}) !== true;
|
||||
}
|
||||
|
||||
qs$('#omnipotenceWidget input').checked = actualState;
|
||||
}
|
||||
|
||||
dom.on(
|
||||
|
Loading…
Reference in New Issue
Block a user