1
0
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:
Raymond Hill 2022-09-27 20:19:59 -04:00
parent fa07a90a53
commit a47484bc33
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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(