Compare commits

...

15 commits

Author SHA1 Message Date
Raymond Hill
12ab8664a3
New revision for stable release 2022-02-23 06:49:08 -05:00
Raymond Hill
00b3a3ea7b
Import translation work from https://crowdin.com/project/ublock 2022-02-23 06:48:18 -05:00
Raymond Hill
6f3c24d76a
Import translation work from https://crowdin.com/project/ublock 2022-02-23 06:47:20 -05:00
Raymond Hill
59a31965a8
Import translation work from https://crowdin.com/project/ublock 2022-02-23 06:46:34 -05:00
Raymond Hill
3a6e3ec5ea
Fix previous commit regarding PSL
The library itself was fixed properly but failed to
properly transcribe the fix manually.

Related commit:
- 38855b1ff6
2022-02-23 06:41:47 -05:00
Raymond Hill
53251e3b0a
Fix testing a 8-bit integer instead of a 32-bit integer in PSL library
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2002

The code was testing only the LSB of a 32-bit integer to detect
whether the current rule was a wildcard (`*`), while it had to
compare against the whole 32-bit integer.

The breakage occurred when the LSB of an offset to the character
buffer happened to match the ASCII code of `*` (42, 0x2A).

(An offset is used when a label is longer than 4 characters)
2022-02-23 06:41:27 -05:00
Raymond Hill
db8f1d4d7c
New revision for stable release 2022-02-18 07:56:07 -05:00
Raymond Hill
38fad8d96f
Tone down highlighted ribbon in popup panel 2022-02-18 07:52:40 -05:00
Raymond Hill
6d90831c5c
Update submodules 2022-02-18 07:52:08 -05:00
Raymond Hill
ae28308c7a
Minor code review
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1992
2022-02-18 07:50:22 -05:00
Raymond Hill
f7d2d0eab6
Use unspoofable Messenger.origin to determine privilege level of ports
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1992
2022-02-18 07:50:06 -05:00
Raymond Hill
bc316a5a7d
Revert "Prevent highly generic cosmetic filters from affecting html/body elements"
This reverts commit 7c8aec250f.

This will be brought back in a future dev cycle. Potentially
related issues:

- https://github.com/uBlockOrigin/uBlock-issues/issues/1978
- https://github.com/uBlockOrigin/uBlock-issues/issues/1983
2022-02-18 07:49:38 -05:00
Raymond Hill
ec935bfaf5
New revision for stable release 2022-02-16 09:34:21 -05:00
Raymond Hill
94959cd1b3
Fix improper handling of match-all removeparam
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1978#issuecomment-1038143619
2022-02-16 09:33:09 -05:00
Raymond Hill
3455552eb5
Rework behavior of "Suspend network activity until ..."
The setting will default to the natural capability of the browser:

- Checked for Firefox
- Unchecked for Chromium-based browsers

For Chromium-based browser, if checked, network requests will be
redirected to an empty resources instead of blocking the
connection.

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1973
- https://www.reddit.com/r/uBlockOrigin/comments/squo8n/latest_update_blocks_network_connections_at/
2022-02-16 09:32:53 -05:00
33 changed files with 120 additions and 114 deletions

2
dist/version vendored
View file

@ -1 +1 @@
1.41.2
1.41.8

View file

@ -183,7 +183,9 @@ vAPI.Tabs = class extends vAPI.Tabs {
suspendOneRequest(details) {
this.suspendedTabIds.add(details.tabId);
return { cancel: true };
return {
redirectUrl: vAPI.getURL(`web_accessible_resources/empty?secret=${vAPI.warSecret()}`)
};
}
unsuspendAllRequests(discard = false) {

View file

@ -831,12 +831,18 @@ browser.browserAction.onClicked.addListener(function(tab) {
// content scripts. Whether a message can trigger a privileged operation is
// decided based on whether the port from which a message is received is
// privileged, which is a status evaluated once, at port connection time.
//
// https://github.com/uBlockOrigin/uBlock-issues/issues/1992
// If present, use MessageSender.origin to determine whether the port is
// from a privileged page, otherwise use MessageSender.url.
// MessageSender.origin is more reliable as it is not spoofable by a
// compromised renderer.
vAPI.messaging = {
ports: new Map(),
listeners: new Map(),
defaultHandler: null,
PRIVILEGED_URL: vAPI.getURL(''),
PRIVILEGED_ORIGIN: vAPI.getURL('').slice(0, -1),
NOOPFUNC: function(){},
UNHANDLED: 'vAPI.messaging.notHandled',
@ -862,10 +868,12 @@ vAPI.messaging = {
);
const portDetails = { port };
const sender = port.sender;
const { tab, url } = sender;
const { origin, tab, url } = sender;
portDetails.frameId = sender.frameId;
portDetails.frameURL = url;
portDetails.privileged = url.startsWith(this.PRIVILEGED_URL);
portDetails.privileged = origin !== undefined
? origin === this.PRIVILEGED_ORIGIN
: url.startsWith(this.PRIVILEGED_ORIGIN);
if ( tab ) {
portDetails.tabId = tab.id;
portDetails.tabURL = tab.url;
@ -1249,7 +1257,7 @@ vAPI.Net = class {
if ( this.suspendDepth !== 0 ) { return; }
this.unsuspendAllRequests(discard);
}
canSuspend() {
static canSuspend() {
return false;
}
};

View file

@ -303,7 +303,7 @@ import {
);
}
}
canSuspend() {
static canSuspend() {
return true;
}
};

View file

@ -336,11 +336,11 @@
"description": "English: Color-blind friendly"
},
"settingsAppearance": {
"message": "Appearance",
"message": "مظهر",
"description": "Section for controlling user interface appearance"
},
"settingsThemeLabel": {
"message": "Theme",
"message": "المظاهر",
"description": "Label for checkbox to enable a custom dark theme"
},
"settingsThemeAccent0Label": {

View file

@ -404,7 +404,7 @@
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Característiques adequades només per a usuaris tècnics.",
"message": "Característiques adequades només per a usuaris tècnics",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {

View file

@ -4,7 +4,7 @@
"description": "extension name."
},
"extShortDesc": {
"message": "Endlich ein effizienter Blocker. Prozessor-freundlich und bescheiden beim Speicherbedarf.",
"message": "Endlich ein effizienter Blocker, der wenig Prozessorleistung und Arbeitsspeicher verbraucht.",
"description": "this will be in the Chrome web store: must be 132 characters or less"
},
"dashboardName": {
@ -44,7 +44,7 @@
"description": "appears as tab name in dashboard"
},
"shortcutsPageName": {
"message": "Tastenkürzel",
"message": "Tastenkombinationen",
"description": "appears as tab name in dashboard"
},
"statsPageName": {
@ -216,11 +216,11 @@
"description": "Label to be used to hide popup panel sections"
},
"popupTipGlobalRules": {
"message": "Globale Regeln: Diese Spalte ist für Regeln, die bei allen Seiten angewendet werden.",
"message": "Globale Regeln: Diese Spalte ist für Regeln, die für alle Websites gelten.",
"description": "Tooltip when hovering the top-most cell of the global-rules column."
},
"popupTipLocalRules": {
"message": "Lokale Regeln: Diese Spalte ist für Regeln, die nur bei dieser Seite angewendet werden.\nLokale Regeln überschreiben globale Regeln.",
"message": "Lokale Regeln: Diese Spalte ist für Regeln, die nur für die aktuelle Website gelten.\nLokale Regeln überschreiben globale Regeln.",
"description": "Tooltip when hovering the top-most cell of the local-rules column."
},
"popupTipSaveRules": {
@ -268,7 +268,7 @@
"description": "appears in popup"
},
"popupHitDomainCount": {
"message": "{{count}} von insgesamt {{total}}",
"message": "{{count}} von {{total}}",
"description": "appears in popup"
},
"popupVersion": {
@ -440,7 +440,7 @@
"description": "A button in the in the _3rd-party filters_ pane"
},
"3pParseAllABPHideFiltersPrompt1": {
"message": "Kosmetische Filter auswerten und deren Anwendung erzwingen.",
"message": "Kosmetische Filter auswerten und anwenden",
"description": "English: Parse and enforce Adblock+ element hiding filters."
},
"3pParseAllABPHideFiltersInfo": {
@ -584,7 +584,7 @@
"description": ""
},
"rulesDefaultFileName": {
"message": "my-ublock-dynamic-rules_{{datetime}}.txt",
"message": "ublock-dynamische-regeln_{{datetime}}.txt",
"description": "default file name to use"
},
"rulesHint": {
@ -688,7 +688,7 @@
"description": "Tooltip for the play button in the logger page"
},
"loggerRowFiltererButtonTip": {
"message": "Protokollierungsfilterung umschalten",
"message": "Protokollierungsfilterung ein-/ausschalten",
"description": "Tooltip for the row filterer button in the logger page"
},
"logFilterPrompt": {
@ -780,7 +780,7 @@
"description": "Small header to identify the static filtering section"
},
"loggerStaticFilteringSentence": {
"message": "{{action}} Netzwerkanfragen {{type}},{{br}}deren URL-Adresse mit {{url}} übereinstimmt{{br}}und von {{origin}} stammen,{{br}}{{importance}} ein übereinstimmender Ausnahme-Filter existiert.\n",
"message": "{{action}} Netzwerkanfragen {{type}},{{br}}deren URL-Adresse mit {{url}} übereinstimmt{{br}}und von {{origin}} stammen,{{br}}{{importance}} ein übereinstimmender Ausnahme-Filter existiert.",
"description": "Used in the static filtering wizard"
},
"loggerStaticFilteringSentencePartBlock": {
@ -1204,11 +1204,11 @@
"description": "A context menu entry, present when large media elements have been blocked on the current site"
},
"shortcutCapturePlaceholder": {
"message": "Tastenkürzel festlegen",
"message": "Tastenkombination drücken",
"description": "Placeholder string for input field used to capture a keyboard shortcut"
},
"genericMergeViewScrollLock": {
"message": "Bildlauf sperren/entsperren",
"message": "Synchrones Scrollen ein-/ausschalten",
"description": "Tooltip for the button used to lock scrolling between the views in the 'My rules' pane"
},
"genericCopyToClipboard": {

View file

@ -340,7 +340,7 @@
"description": "Section for controlling user interface appearance"
},
"settingsThemeLabel": {
"message": "Theme",
"message": "Etoso",
"description": "Label for checkbox to enable a custom dark theme"
},
"settingsThemeAccent0Label": {
@ -596,7 +596,7 @@
"description": "English: dynamic rule syntax and full documentation."
},
"rulesSort": {
"message": "Sort:",
"message": "Ordigi:",
"description": "English: label for sort option."
},
"rulesSortByType": {
@ -608,7 +608,7 @@
"description": "English: a sort option for list of rules."
},
"rulesSortByDestination": {
"message": "Destination",
"message": "Celo",
"description": "English: a sort option for list of rules."
},
"whitelistPrompt": {

View file

@ -404,7 +404,7 @@
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Teknisille käyttäjille sopivat ominaisuudet.",
"message": "Teknisille käyttäjille sopivat ominaisuudet",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {

View file

@ -336,15 +336,15 @@
"description": "English: Color-blind friendly"
},
"settingsAppearance": {
"message": "Appearance",
"message": "נראות",
"description": "Section for controlling user interface appearance"
},
"settingsThemeLabel": {
"message": "Theme",
"message": "ערכת נושא",
"description": "Label for checkbox to enable a custom dark theme"
},
"settingsThemeAccent0Label": {
"message": "Custom accent color",
"message": "צבע הדגשה מותאם",
"description": "Label for checkbox to pick an accent color"
},
"settingsCloudStorageEnabledPrompt": {
@ -400,11 +400,11 @@
"description": "background information: https://github.com/uBlockOrigin/uBlock-issues/issues/1513"
},
"settingsAdvanced": {
"message": "Advanced",
"message": "מתקדם",
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Features suitable only for technical users",
"message": "מאפיינים למשתמשים טכניים בלבד",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {
@ -964,7 +964,7 @@
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option1": {
"message": "הצגת מודעות או שאריות מודעות",
"message": "הצגת פרסומות או שאריות של פרסומות",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option2": {

View file

@ -112,7 +112,7 @@
"description": "For the new mobile-friendly popup design"
},
"popupTipDashboard": {
"message": "डैशबोर्ड को खोलने के लिए क्लिक करें",
"message": "डैशबोर्ड खोलें",
"description": "English: Click to open the dashboard"
},
"popupTipZapper": {

View file

@ -344,7 +344,7 @@
"description": "Label for checkbox to enable a custom dark theme"
},
"settingsThemeAccent0Label": {
"message": "Warna akses khusus",
"message": "Warna aksen khusus",
"description": "Label for checkbox to pick an accent color"
},
"settingsCloudStorageEnabledPrompt": {

View file

@ -200,7 +200,7 @@
"description": "Caption for the no-cosmetic-filtering per-site switch"
},
"popupNoRemoteFonts_v2": {
"message": "원격 폰트",
"message": "외부 폰트",
"description": "Caption for the no-remote-fonts per-site switch"
},
"popupNoScripting_v2": {

View file

@ -404,7 +404,7 @@
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Alleen voor technische gebruikers geschikte functies.",
"message": "Alleen voor technische gebruikers geschikte functies",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {
@ -532,11 +532,11 @@
"description": "Short information about how to create custom filters"
},
"1pImport": {
"message": "Importeren en toevoegen...",
"message": "Importeren en toevoegen",
"description": "English: Import and append"
},
"1pExport": {
"message": "Exporteren...",
"message": "Exporteren",
"description": "English: Export"
},
"1pExportFilename": {
@ -580,7 +580,7 @@
"description": ""
},
"rulesExport": {
"message": "Exporteren naar bestand...",
"message": "Exporteren naar bestand",
"description": ""
},
"rulesDefaultFileName": {
@ -616,11 +616,11 @@
"description": "A concise description of the 'Trusted sites' pane."
},
"whitelistImport": {
"message": "Importeren en toevoegen...",
"message": "Importeren en toevoegen",
"description": "English: Import and append"
},
"whitelistExport": {
"message": "Exporteren...",
"message": "Exporteren",
"description": "English: Export"
},
"whitelistExportFilename": {
@ -1040,7 +1040,7 @@
"description": "Shown in the About pane"
},
"aboutBackupDataButton": {
"message": "Back-up maken naar bestand...",
"message": "Back-up maken naar bestand",
"description": "Text for button to create a backup of all settings"
},
"aboutBackupFilename": {

View file

@ -404,7 +404,7 @@
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Funkcje odpowiednie tylko dla użytkowników z przygotowaniem technicznym",
"message": "Funkcje odpowiednie tylko dla zaawansowanych użytkowników",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {
@ -920,7 +920,7 @@
"description": "Second paragraph of 'Filter issues' section in Support pane"
},
"supportS3P3": {
"message": "<b>Porada:</b> upewnij się, że listy filtrów są aktualne. <span data-url=\"logger-ui.html#_\">Rejestrator</span> jest głównym narzędziem do diagnozowania problemów z filtrowaniem.",
"message": "<b>Porada:</b> Upewnij się, że listy filtrów są aktualne. <span data-url=\"logger-ui.html#_\">Rejestrator</span> jest głównym narzędziem do diagnozowania problemów z filtrowaniem.",
"description": "Third paragraph of 'Filter issues' section in Support pane"
},
"supportS4H": {

View file

@ -64,7 +64,7 @@
"description": "Title for the asset viewer page"
},
"advancedSettingsPageName": {
"message": "Parametra avancuar",
"message": "Parametrat e avancuar",
"description": "Title for the advanced settings page"
},
"popupPowerSwitchInfo": {
@ -340,11 +340,11 @@
"description": "Section for controlling user interface appearance"
},
"settingsThemeLabel": {
"message": "Tema",
"message": "Motivi",
"description": "Label for checkbox to enable a custom dark theme"
},
"settingsThemeAccent0Label": {
"message": "Custom accent color",
"message": "Personalizoj ngjyrën e theksuar",
"description": "Label for checkbox to pick an accent color"
},
"settingsCloudStorageEnabledPrompt": {
@ -352,7 +352,7 @@
"description": ""
},
"settingsAdvancedUserPrompt": {
"message": "Jam një përdorues i përparuar (<a href='https://github.com/gorhill/uBlock/wiki/Advanced-user-features'>Lexim i detyruar</a>)",
"message": "Kam njohuri të thelluara",
"description": "Checkbox to let user access advanced, technical features"
},
"settingsPrefetchingDisabledPrompt": {
@ -400,15 +400,15 @@
"description": "background information: https://github.com/uBlockOrigin/uBlock-issues/issues/1513"
},
"settingsAdvanced": {
"message": "Të përparuar",
"message": "Parametrat e avancuar",
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Veçori të përshtatshme për përdoruesit teknikë",
"message": "Funksione të përshtatshme vetëm për specialistët",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {
"message": "parametra avancuar",
"message": "parametrat e avancuar",
"description": "For the tooltip of a link which gives access to advanced settings"
},
"settingsLastRestorePrompt": {
@ -916,11 +916,11 @@
"description": "First paragraph of 'Filter issues' section in Support pane"
},
"supportS3P2": {
"message": "<b>Vërejtje:</b> uBlock Origin nuk duhet përdorur njëkohësisht me aplikacionet e ngjashme bllokuese, pasi disa faqe mund të kenë probleme me filtrat.",
"message": "<b>Vërejtje:</b> uBlock Origin nuk duhet përdorur njëkohësisht me aplikacionet e ngjashme bllokuese, pasi disa faqe mund të shfaqin probleme me filtrat.",
"description": "Second paragraph of 'Filter issues' section in Support pane"
},
"supportS3P3": {
"message": "<b>Këshilla:</b> Sigurohuni që listat e filtrave janë të përditësuara. <span data-url=\"logger-ui.html#_\">Regjistri</span> është instrumenti kryesor për të diagnostikuar problemet me filtrat.",
"message": "<b>Këshilla:</b> Sigurohuni që listat e filtrave janë të përditësuara. <span data-url=\"logger-ui.html#_\">Regjistri</span> është instrumenti kryesor për diagnostikimin e problemeve me filtrat.",
"description": "Third paragraph of 'Filter issues' section in Support pane"
},
"supportS4H": {
@ -1000,7 +1000,7 @@
"description": "Text for 'Unredact' button"
},
"aboutPrivacyPolicy": {
"message": "Politikat e konfidencialitetit",
"message": "Politika e konfidencialitetit",
"description": "Link to privacy policy on GitHub (English)"
},
"aboutChangelog": {

View file

@ -404,7 +404,7 @@
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "Функције погодне само за техничке кориснике.",
"message": "Функције прикладне само за техничке кориснике",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {

View file

@ -336,7 +336,7 @@
"description": "English: Color-blind friendly"
},
"settingsAppearance": {
"message": "界面外观",
"message": "外观",
"description": "Section for controlling user interface appearance"
},
"settingsThemeLabel": {
@ -400,11 +400,11 @@
"description": "background information: https://github.com/uBlockOrigin/uBlock-issues/issues/1513"
},
"settingsAdvanced": {
"message": "高级设定",
"message": "高级",
"description": "Section for controlling advanced-user settings"
},
"settingsAdvancedSynopsis": {
"message": "仅为专家用户提供的功能。",
"message": "仅适合专家级用户的功能。",
"description": "Description of section controlling advanced-user settings"
},
"settingsAdvancedUserSettings": {

View file

@ -190,6 +190,10 @@ body.needSave #revertRules {
unicode-bidi: embed;
visibility: hidden;
}
.toolRibbon .tool:hover {
color: var(--ink-1);
fill: var(--ink-1);
}
.toolRibbon .tool.enabled {
visibility: visible;
}

View file

@ -437,11 +437,11 @@
--popup-cell-block-own-surface: rgb(var(--popup-cell-block-own-surface-rgb));
--popup-cell-block-surface: rgb(var(--popup-cell-block-surface-rgb));
--popup-power-ink: rgb(var(--popup-power-ink-rgb));
--popup-toolbar-surface: rgb(var(--primary-80) / 20%);
--popup-toolbar-surface-hover: rgb(var(--primary-80) / 25%);
--popup-toolbar-surface: rgb(var(--primary-80) / 15%);
--popup-toolbar-surface-hover: rgb(var(--primary-80) / 20%);
--popup-ruleset-tool-ink: var(--ink-1);
--popup-ruleset-tool-surface: rgb(var(--primary-80) / 20%);
--popup-ruleset-tool-surface-hover: rgb(var(--primary-80) / 25%);
--popup-ruleset-tool-surface: rgb(var(--primary-80) / 15%);
--popup-ruleset-tool-surface-hover: rgb(var(--primary-80) / 20%);
--popup-ruleset-tool-shadow: transparent;
}

View file

@ -110,7 +110,7 @@ const userSettingsDefault = {
prefetchingDisabled: true,
requestLogMaxEntries: 1000,
showIconBadge: true,
suspendUntilListsAreLoaded: true,
suspendUntilListsAreLoaded: vAPI.Net.canSuspend(),
tooltipsDisabled: false,
webrtcIPAddressHidden: false,
};

View file

@ -676,11 +676,6 @@ vAPI.DOMFilterer = class {
getAllExceptionSelectors() {
return this.exceptions.join(',\n');
}
unwrapSelector(s) {
const match = /^:is\((.+)\):not\(html,body\)\/\*hg\*\/$/.exec(s);
return match !== null ? match[1] : s;
}
};
/******************************************************************************/

View file

@ -227,11 +227,13 @@ const FilterContainer = function() {
this.highlyGeneric.simple = {
canonical: 'highGenericHideSimple',
dict: new Set(),
str: '',
mru: new µb.MRUCache(16)
};
this.highlyGeneric.complex = {
canonical: 'highGenericHideComplex',
dict: new Set(),
str: '',
mru: new µb.MRUCache(16)
};
@ -279,16 +281,11 @@ FilterContainer.prototype.reset = function() {
// highly generic selectors sets
this.highlyGeneric.simple.dict.clear();
this.highlyGeneric.simple.str = '';
this.highlyGeneric.simple.mru.reset();
this.highlyGeneric.complex.dict.clear();
this.highlyGeneric.complex.str = '';
this.highlyGeneric.complex.mru.reset();
// https://developer.mozilla.org/en-US/docs/Web/CSS/:is#browser_compatibility
// https://developer.mozilla.org/en-US/docs/Web/CSS/:not#browser_compatibility
// Need support for both `:is()` and `:not()` with selector list.
this.cssIs =
vAPI.webextFlavor.soup.has('firefox') && vAPI.webextFlavor.major >= 84 ||
vAPI.webextFlavor.soup.has('chromium') && vAPI.webextFlavor.major >= 88;
};
/******************************************************************************/
@ -303,7 +300,9 @@ FilterContainer.prototype.freeze = function() {
this.lowlyGeneric.cl.simple.size !== 0 ||
this.lowlyGeneric.cl.complex.size !== 0;
this.highlyGeneric.simple.str = Array.from(this.highlyGeneric.simple.dict).join(',\n');
this.highlyGeneric.simple.mru.reset();
this.highlyGeneric.complex.str = Array.from(this.highlyGeneric.complex.dict).join(',\n');
this.highlyGeneric.complex.mru.reset();
this.frozen = true;
@ -707,7 +706,9 @@ FilterContainer.prototype.fromSelfie = function(selfie) {
this.lowlyGeneric.cl.simple = new Set(selfie.lowlyGenericSCL);
this.lowlyGeneric.cl.complex = new Map(selfie.lowlyGenericCCL);
this.highlyGeneric.simple.dict = new Set(selfie.highSimpleGenericHideArray);
this.highlyGeneric.simple.str = selfie.highSimpleGenericHideArray.join(',\n');
this.highlyGeneric.complex.dict = new Set(selfie.highComplexGenericHideArray);
this.highlyGeneric.complex.str = selfie.highComplexGenericHideArray.join(',\n');
this.needDOMSurveyor =
selfie.lowlyGenericSID.length !== 0 ||
selfie.lowlyGenericCID.length !== 0 ||
@ -1041,19 +1042,14 @@ FilterContainer.prototype.retrieveSpecificSelectors = function(
// indirectly in the mru cache: this is to prevent duplication of the
// string in memory, which I have observed occurs when the string is
// stored directly as a value in a Map.
//
// https://github.com/uBlockOrigin/uBlock-issues/issues/1692
// Wrap generic selectors to prevent matching `html` or `body`
// elements. Content script-side code must unwrap those selectors
// before reporting them in a user interface.
if ( options.noGenericCosmeticFiltering !== true ) {
const exceptionSetHash = out.exceptionFilters.join();
for ( const key in this.highlyGeneric ) {
const entry = this.highlyGeneric[key];
let genericSet = entry.dict;
let cache = entry.mru.lookup(exceptionSetHash);
if ( cache === undefined ) {
cache = { s: '', excepted: [] };
let str = entry.mru.lookup(exceptionSetHash);
if ( str === undefined ) {
str = { s: entry.str, excepted: [] };
let genericSet = entry.dict;
let hit = false;
for ( const exception of exceptionSet ) {
if ( (hit = genericSet.has(exception)) ) { break; }
@ -1062,23 +1058,18 @@ FilterContainer.prototype.retrieveSpecificSelectors = function(
genericSet = new Set(entry.dict);
for ( const exception of exceptionSet ) {
if ( genericSet.delete(exception) ) {
cache.excepted.push(exception);
str.excepted.push(exception);
}
}
str.s = Array.from(genericSet).join(',\n');
}
let genericArr = Array.from(genericSet);
if ( this.cssIs ) {
genericArr =
genericArr.map(a => `:is(${a}):not(html,body)/*hg*/`);
}
cache.s = genericArr.join(',\n');
entry.mru.add(exceptionSetHash, cache);
entry.mru.add(exceptionSetHash, str);
}
if ( cache.excepted.length !== 0 ) {
out.exceptedFilters.push(...cache.excepted);
if ( str.excepted.length !== 0 ) {
out.exceptedFilters.push(...str.excepted);
}
if ( cache.s.length !== 0 ) {
injectedHideFilters.push(cache.s);
if ( str.s.length !== 0 ) {
injectedHideFilters.push(str.s);
}
}
}

View file

@ -91,7 +91,6 @@ const processDeclarativeSimple = function(node, out) {
) {
return;
}
const unwrapSelector = vAPI.domFilterer.unwrapSelector;
for ( const selector of simpleDeclarativeSet ) {
if (
(node === document || safeMatchSelector(selector, node) === false) &&
@ -99,7 +98,7 @@ const processDeclarativeSimple = function(node, out) {
) {
continue;
}
out.push(`##${unwrapSelector(selector)}`);
out.push(`##${selector}`);
simpleDeclarativeSet.delete(selector);
simpleDeclarativeStr = undefined;
loggedSelectors.add(selector);
@ -114,10 +113,9 @@ const processDeclarativeComplex = function(out) {
complexDeclarativeStr = safeGroupSelectors(complexDeclarativeSet);
}
if ( document.querySelector(complexDeclarativeStr) === null ) { return; }
const unwrapSelector = vAPI.domFilterer.unwrapSelector;
for ( const selector of complexDeclarativeSet ) {
if ( safeQuerySelector(selector) === null ) { continue; }
out.push(`##${unwrapSelector(selector)}`);
out.push(`##${selector}`);
complexDeclarativeSet.delete(selector);
complexDeclarativeStr = undefined;
loggedSelectors.add(selector);

View file

@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2015-present Raymond Hill
Copyright (C) 2015-2018 Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -509,7 +509,7 @@ const cosmeticFilterMapper = (function() {
// Declarative selectors.
for ( const entry of (details.declarative || []) ) {
for ( const selector of entry[0].split(',\n') ) {
let canonical = vAPI.domFilterer.unwrapSelector(selector);
let canonical = selector;
let nodes;
if ( entry[1] !== vAPI.hideStyle ) {
canonical += ':style(' + entry[1] + ')';

View file

@ -201,10 +201,20 @@ const onNetWhitelistReady = function(netWhitelistRaw, adminExtra) {
const onUserSettingsReady = function(fetched) {
// Terminate suspended state?
if ( fetched.suspendUntilListsAreLoaded === false ) {
const tnow = Date.now() - vAPI.T0;
if (
vAPI.Net.canSuspend() &&
fetched.suspendUntilListsAreLoaded === false
) {
vAPI.net.unsuspend({ all: true, discard: true });
ubolog(`Unsuspend network activity listener`);
µb.supportStats.unsuspendAfter = `${Date.now() - vAPI.T0} ms`;
ubolog(`Unsuspend network activity listener at ${tnow} ms`);
µb.supportStats.unsuspendAfter = `${tnow} ms`;
} else if (
vAPI.Net.canSuspend() === false &&
fetched.suspendUntilListsAreLoaded
) {
vAPI.net.suspend();
ubolog(`Suspend network activity listener at ${tnow} ms`);
}
// `externalLists` will be deprecated in some future, it is kept around

View file

@ -2926,11 +2926,7 @@ class FilterCompiler {
processModifierOption(modifier, value) {
if ( this.modifyType !== undefined ) { return false; }
this.modifyType = modifier;
if ( value !== undefined ) {
this.modifyValue = value;
} else if ( this.action === AllowAction ) {
this.modifyValue = '';
}
this.modifyValue = value || '';
return true;
}

View file

@ -805,7 +805,7 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
const onFilterListsReady = function(lists) {
this.availableFilterLists = lists;
if ( vAPI.net.canSuspend() ) {
if ( vAPI.Net.canSuspend() ) {
vAPI.net.suspend();
}
redirectEngine.reset();

View file

@ -1136,7 +1136,9 @@ const webRequest = {
start: (( ) => {
vAPI.net = new vAPI.Net();
vAPI.net.suspend();
if ( vAPI.Net.canSuspend() ) {
vAPI.net.suspend();
}
return async ( ) => {
vAPI.net.setSuspendableListener(onBeforeRequest);

View file

@ -403,7 +403,7 @@ const getPublicSuffixPosJS = function() {
}
// 2. If no rules match, the prevailing rule is "*".
if ( iFound === 0 ) {
if ( buf8[iCandidates + 1 << 2] !== 0x2A /* '*' */ ) { break; }
if ( buf32[iCandidates + 1] !== 0x2A /* '*' */ ) { break; }
buf8[SUFFIX_NOT_FOUND_SLOT] = 1;
iFound = iCandidates;
}

View file

@ -255,7 +255,7 @@
i32.eqz
if
get_local $iCandidates
i32.load8_u offset=4
i32.load offset=4
i32.const 0x2A
i32.ne
br_if $labelLookupDone

@ -1 +1 @@
Subproject commit 6eb110153ca39e7e7af14456ebaf1de2eff8ac4c
Subproject commit 51417b36f28f1608352b0c0a9d53d80fa3e85a00