mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Allow call to removeCSS in Chromium
Related discussion: - https://github.com/gorhill/uBlock/issues/3588#issuecomment-702218677
This commit is contained in:
parent
bafbb7d62c
commit
db0d200fcb
2 changed files with 4 additions and 5 deletions
|
@ -1027,11 +1027,9 @@ vAPI.messaging = {
|
|||
details.code = cssText;
|
||||
promises.push(vAPI.tabs.insertCSS(tabId, details));
|
||||
}
|
||||
if ( typeof webext.tabs.removeCSS === 'function' ) {
|
||||
for ( const cssText of msg.remove ) {
|
||||
details.code = cssText;
|
||||
promises.push(vAPI.tabs.removeCSS(tabId, details));
|
||||
}
|
||||
for ( const cssText of msg.remove ) {
|
||||
details.code = cssText;
|
||||
promises.push(vAPI.tabs.removeCSS(tabId, details));
|
||||
}
|
||||
Promise.all(promises).then(( ) => {
|
||||
callback();
|
||||
|
|
|
@ -93,6 +93,7 @@ const webext = {
|
|||
get: promisifyNoFail(chrome.tabs, 'get', tab => tab instanceof Object ? tab : null),
|
||||
executeScript: promisifyNoFail(chrome.tabs, 'executeScript'),
|
||||
insertCSS: promisifyNoFail(chrome.tabs, 'insertCSS'),
|
||||
removeCSS: promisifyNoFail(chrome.tabs, 'removeCSS'),
|
||||
query: promisifyNoFail(chrome.tabs, 'query', tabs => Array.isArray(tabs) ? tabs : []),
|
||||
reload: promisifyNoFail(chrome.tabs, 'reload'),
|
||||
remove: promisifyNoFail(chrome.tabs, 'remove'),
|
||||
|
|
Loading…
Reference in a new issue