mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3][safari] Minor code review
This commit is contained in:
parent
22d2ecc472
commit
6fb58f8599
1 changed files with 9 additions and 12 deletions
|
|
@ -39,19 +39,16 @@ if ( details?.proceduralSelectors?.length ) {
|
|||
}
|
||||
}
|
||||
|
||||
const inserted = new Set();
|
||||
|
||||
if ( Array.isArray(details?.plainSelectors) ) {
|
||||
inserted.add(`${details.plainSelectors.join(',\n')}{display:none!important;}`);
|
||||
}
|
||||
|
||||
self.addEventListener('pageshow', ( ) => {
|
||||
chrome.runtime.sendMessage({
|
||||
what: 'insertCSS',
|
||||
css: Array.from(inserted).join('\n'),
|
||||
}).catch(( ) => {
|
||||
if ( details?.plainSelectors?.length ) {
|
||||
const selectors = details.plainSelectors;
|
||||
self.addEventListener('pageshow', ( ) => {
|
||||
chrome.runtime.sendMessage({
|
||||
what: 'insertCSS',
|
||||
css: `${selectors.join(',\n')}{display:none!important;}`,
|
||||
}).catch(( ) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
self.customFilters = details;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue