From 8aeb670be1d252807252ee2bfe99b15b81c3e28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Wed, 6 Apr 2022 10:38:06 +0800 Subject: update from upstream --- Makefile | 32 +- assets/assets.json | 2 +- bootstrap.js | 55 +- css/cloud-ui.css | 40 +- css/common.css | 4 +- css/dashboard-common.css | 46 +- css/dashboard.css | 22 +- css/hosts-files.css | 76 +- css/legacy-toolbar-button.css | 4 +- css/logger-ui.css | 112 +-- css/popup.css | 286 +++---- css/raw-settings.css | 10 +- css/user-rules.css | 64 +- frameScript.js | 36 +- install.rdf | 2 +- js/about.js | 2 +- js/asset-viewer.js | 8 +- js/assets.js | 1744 +++++++++++++++++++------------------- js/background.js | 170 ++-- js/browsercache.js | 34 +- js/cloud-ui.js | 132 +-- js/contentscript-start.js | 20 +- js/contentscript.js | 558 ++++++------ js/cookies.js | 374 ++++---- js/dashboard-common.js | 8 +- js/dashboard.js | 6 +- js/hosts-files.js | 340 ++++---- js/httpsb.js | 4 +- js/i18n.js | 208 ++--- js/liquid-dict.js | 314 +++---- js/logger-ui.js | 798 ++++++++--------- js/logger.js | 10 +- js/main-blocked.js | 2 +- js/matrix.js | 1394 +++++++++++++++--------------- js/messaging.js | 24 +- js/pagestats.js | 186 ++-- js/polyfill.js | 4 +- js/popup.js | 1572 +++++++++++++++++----------------- js/profiler.js | 4 +- js/raw-settings.js | 144 ++-- js/settings.js | 124 +-- js/start.js | 70 +- js/storage.js | 14 +- js/tab.js | 562 ++++++------ js/traffic.js | 4 +- js/udom.js | 7 +- js/uritools.js | 886 +++++++++---------- js/user-rules.js | 308 +++---- js/usersettings.js | 4 +- js/utils.js | 4 +- js/vapi-background.js | 1241 ++++++++++++--------------- js/vapi-browser.js | 244 +++--- js/vapi-client.js | 170 ++-- js/vapi-cloud.js | 110 +-- js/vapi-common.js | 142 ++-- js/vapi-contextmenu.js | 182 ++-- js/vapi-cookies.js | 96 +-- js/vapi-core.js | 114 +-- js/vapi-messaging.js | 132 +-- js/vapi-net.js | 50 +- js/vapi-popup.js | 4 +- js/vapi-storage.js | 260 +++--- js/vapi-tabs.js | 666 +++++++-------- js/vapi-window.js | 170 ++-- js/xal.js | 60 +- lib/CallbackWrapper.jsm | 14 +- lib/CookieCache.jsm | 162 ++-- lib/FrameModule.jsm | 74 +- lib/HostMap.jsm | 28 +- lib/HttpRequestHeaders.jsm | 18 +- lib/LiquidDict.jsm | 90 +- lib/PendingRequests.jsm | 100 +-- lib/PublicSuffixList.jsm | 268 +++--- lib/Punycode.jsm | 262 +++--- lib/RowSnapshot.jsm | 2 +- lib/Tools.jsm | 112 +-- lib/UriTools.jsm | 390 ++++----- lib/publicsuffixlist.js | 556 ++++++------ lib/punycode.js | 1050 +++++++++++------------ locale/bg/messages.properties | 12 +- locale/cs/messages.properties | 12 +- locale/de/messages.properties | 14 +- locale/el/messages.properties | 12 +- locale/en/messages.properties | 12 +- locale/eo/messages.properties | 186 ---- locale/es/messages.properties | 42 +- locale/et/messages.properties | 186 ---- locale/fa/messages.properties | 186 ---- locale/fi/messages.properties | 186 ---- locale/fil/messages.properties | 186 ---- locale/fr/messages.properties | 32 +- locale/he/messages.properties | 186 ---- locale/hi/messages.properties | 186 ---- locale/hu/messages.properties | 12 +- locale/id/messages.properties | 186 ---- locale/it/messages.properties | 12 +- locale/ja/messages.properties | 187 ---- locale/ko/messages.properties | 12 +- locale/lv/messages.properties | 186 ---- locale/ml/messages.properties | 186 ---- locale/nb/messages.properties | 186 ---- locale/nl/messages.properties | 12 +- locale/pl/messages.properties | 12 +- locale/pt-BR/messages.properties | 14 +- locale/pt-PT/messages.properties | 16 +- locale/ro/messages.properties | 186 ---- locale/ru/messages.properties | 12 +- locale/sl/messages.properties | 186 ---- locale/sr/messages.properties | 186 ---- locale/sv/messages.properties | 12 +- locale/te/messages.properties | 186 ---- locale/tr/messages.properties | 12 +- locale/uk/messages.properties | 12 +- locale/vi/messages.properties | 186 ---- locale/zh-CN/messages.properties | 14 +- locale/zh-TW/messages.properties | 186 ---- options.xul | 4 +- 117 files changed, 8842 insertions(+), 12400 deletions(-) delete mode 100644 locale/eo/messages.properties delete mode 100644 locale/et/messages.properties delete mode 100644 locale/fa/messages.properties delete mode 100644 locale/fi/messages.properties delete mode 100644 locale/fil/messages.properties delete mode 100644 locale/he/messages.properties delete mode 100644 locale/hi/messages.properties delete mode 100644 locale/id/messages.properties delete mode 100644 locale/ja/messages.properties delete mode 100644 locale/lv/messages.properties delete mode 100644 locale/ml/messages.properties delete mode 100644 locale/nb/messages.properties delete mode 100644 locale/ro/messages.properties delete mode 100644 locale/sl/messages.properties delete mode 100644 locale/sr/messages.properties delete mode 100644 locale/te/messages.properties delete mode 100644 locale/vi/messages.properties delete mode 100644 locale/zh-TW/messages.properties diff --git a/Makefile b/Makefile index b1dd2bd..a78fb18 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ # 2) It gives some flexibility in that files can be created or deleted # freely as long as they are not part of any of these lists -VERSION := 3.1.2 +VERSION := 3.1.3 help: @echo 'Makefile for generate eMatrix ' @@ -109,30 +109,18 @@ LOC1 := locale/en/messages.properties locale/bg/messages.properties \ locale/cs/messages.properties locale/de/messages.properties \ locale/el/messages.properties -LOC2 := locale/eo/messages.properties locale/es/messages.properties \ - locale/et/messages.properties locale/fa/messages.properties \ - locale/fi/messages.properties locale/fil/messages.properties \ - locale/fr/messages.properties locale/he/messages.properties +LOC2 := locale/es/messages.properties locale/fr/messages.properties \ + locale/hu/messages.properties locale/it/messages.properties \ + locale/ko/messages.properties locale/nl/messages.properties \ + locale/pl/messages.properties -LOC3 := locale/hi/messages.properties locale/hu/messages.properties \ - locale/id/messages.properties locale/it/messages.properties \ - locale/ja/messages.properties locale/ko/messages.properties \ - locale/lv/messages.properties locale/ml/messages.properties - -LOC4 := locale/nb/messages.properties locale/nl/messages.properties \ - locale/pl/messages.properties \ - locale/pt-BR/messages.properties \ +LOC3 := locale/pt-BR/messages.properties \ locale/pt-PT/messages.properties \ - locale/ro/messages.properties locale/ru/messages.properties \ - locale/sl/messages.properties - -LOC5 := locale/sr/messages.properties locale/sv/messages.properties \ - locale/te/messages.properties locale/tr/messages.properties \ - locale/uk/messages.properties locale/vi/messages.properties \ - locale/zh-CN/messages.properties \ - locale/zh-TW/messages.properties + locale/ru/messages.properties locale/sv/messages.properties \ + locale/tr/messages.properties locale/uk/messages.properties \ + locale/zh-CN/messages.properties -LOCALE := $(LOC1) $(LOC2) $(LOC3) $(LOC4) $(LOC5) +LOCALE := $(LOC1) $(LOC2) $(LOC3) # The js folder is split into parts because it's a long list # and it's somewhat easier to read this way diff --git a/assets/assets.json b/assets/assets.json index 082e8a6..bee211a 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -36,7 +36,7 @@ "https://someonewhocares.org/hosts/hosts", "assets/thirdparties/someonewhocares.org/hosts/hosts.txt" ], - "supportURL": "https://someonewhocares.org/hosts/" + "supportURL": "http://someonewhocares.org/hosts/" }, "mvps-0": { "content": "filters", diff --git a/bootstrap.js b/bootstrap.js index 0127d89..c49d77b 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2014-2019 The uMatrix/uBlock Origin authors - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -36,7 +36,7 @@ let version; const restartListener = { get messageManager() { return Cc['@mozilla.org/parentprocessmessagemanager;1'] - .getService(Ci.nsIMessageListenerManager); + .getService(Ci.nsIMessageListenerManager); }, receiveMessage: function() { @@ -64,20 +64,21 @@ function startup(data, reason) { function createBgProcess(parentDocument) { bgProcess = parentDocument - .documentElement - .appendChild(parentDocument - .createElementNS('http://www.w3.org/1999/xhtml', - 'iframe')); + .documentElement + .appendChild(parentDocument + .createElementNS('http://www.w3.org/1999/xhtml', + 'iframe')); bgProcess.setAttribute('src', - 'chrome://ematrix/content/background.html#' - + version); + 'chrome://ematrix/content/background.html#' + + version); + // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener%28%29 // "If the same listener registers twice for the same message, the // "second registration is ignored." restartListener - .messageManager - .addMessageListener('ematrix-restart', restartListener); + .messageManager + .addMessageListener('ematrix-restart', restartListener); } function getWindowlessBrowserFrame(appShell) { @@ -96,8 +97,8 @@ function getWindowlessBrowserFrame(appShell) { onStateChange: function(wbp, request, stateFlags, status) { if (!request) { - return; - } + return; + } if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP) { webProgress.removeProgressListener(windowlessBrowserPL); @@ -108,10 +109,10 @@ function getWindowlessBrowserFrame(appShell) { }; webProgress.addProgressListener(windowlessBrowserPL, - Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT); + Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT); windowlessBrowser.document.location = - "data:application/vnd.mozilla.xul+xml;charset=utf-8,"; + "data:application/vnd.mozilla.xul+xml;charset=utf-8,"; } function waitForHiddenWindow() { @@ -123,7 +124,7 @@ function waitForHiddenWindow() { try { hiddenDoc = appShell.hiddenDOMWindow && - appShell.hiddenDOMWindow.document; + appShell.hiddenDOMWindow.document; } catch (ex) { } @@ -205,7 +206,7 @@ function shutdown(data, reason) { if (windowlessBrowser !== null) { // close() does not exist for older versions of Firefox. - // ηMatrix: how old? But keeping it doesn't really hurt that much. + // ηMatrix: how old? But keeping it doesn't really hurt that much. if (typeof windowlessBrowser.close === 'function') { windowlessBrowser.close(); } @@ -219,22 +220,22 @@ function shutdown(data, reason) { // Remove the restartObserver only when the extension is being disabled restartListener - .messageManager - .removeMessageListener('ematrix-restart', restartListener); + .messageManager + .removeMessageListener('ematrix-restart', restartListener); } function install(data, reason) { // https://bugzil.la/719376 Cc['@mozilla.org/intl/stringbundle;1'] - .getService(Ci.nsIStringBundleService) - .flushBundles(); + .getService(Ci.nsIStringBundleService) + .flushBundles(); if (reason === ADDON_UPGRADE) { - let Services = - Cu.import('resource://gre/modules/Services.jsm', null).Services + let Services = + Cu.import('resource://gre/modules/Services.jsm', null).Services - Services.obs.notifyObservers(null, 'chrome-flush-caches', null); - Services.obs.notifyObservers(null, 'message-manager-flush-caches', null); + Services.obs.notifyObservers(null, 'chrome-flush-caches', null); + Services.obs.notifyObservers(null, 'message-manager-flush-caches', null); } } @@ -246,6 +247,6 @@ function uninstall(data, aReason) { // To cleanup vAPI.localStorage in vapi-common.js, aka // "extensions.ematrix.*" in `about:config`. Cu.import('resource://gre/modules/Services.jsm', null) - .Services.prefs.getBranch('extensions.ematrix') - .deleteBranch(''); + .Services.prefs.getBranch('extensions.ematrix.') + .deleteBranch(''); } diff --git a/css/cloud-ui.css b/css/cloud-ui.css index 64dea40..2e53f70 100644 --- a/css/cloud-ui.css +++ b/css/cloud-ui.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -26,10 +26,10 @@ margin: 0.5em 0; padding: 1em 1em 0 1em; position: relative; -} + } #cloudWidget.hide { display: none; -} + } #cloudWidget > button { display: inline-block; font-family: FontAwesome; @@ -40,30 +40,30 @@ padding: 0.2em 0.25em 0.1em 0.25em; position: relative; vertical-align: baseline; -} + } #cloudWidget > button[disabled] { visibility: hidden; -} + } #cloudWidget > button.error { color: red; -} + } #cloudPush:after { content: '\f0ee'; -} + } #cloudPull:before, #cloudPullAndMerge:before { content: '\f0ed'; } #cloudPullAndMerge { margin: 0 0.25em; -} + } #cloudPullAndMerge:after { content: '\f067'; font-size: 50%; position: absolute; right: 0; top: 10%; -} + } #cloudWidget > span { color: gray; display: inline-block; @@ -72,15 +72,15 @@ padding: 0; vertical-align: bottom; white-space: pre; -} + } #cloudError { color: red; margin: 0; padding: 0.5em 0; -} + } #cloudError > span { font-size: x-small; -} + } #cloudWidget > #cloudCog { cursor: pointer; display: inline-block; @@ -90,16 +90,16 @@ padding: 4px; position: absolute; top: 0; -} + } body[dir="ltr"] #cloudWidget > #cloudCog { right: 0; -} + } body[dir="rtl"] #cloudWidget > #cloudCog { left: 0; -} + } #cloudWidget > #cloudCog:hover { opacity: 1; -} + } #cloudWidget > #cloudOptions { align-items: center; -webkit-align-items: center; @@ -113,14 +113,14 @@ body[dir="rtl"] #cloudWidget > #cloudCog { right: 0; top: 0; z-index: 2000; -} + } #cloudWidget > #cloudOptions.show { display: flex; display: -webkit-flex; -} + } #cloudWidget > #cloudOptions > div { background-color: white; border-radius: 3px; padding: 1em; text-align: center; -} + } diff --git a/css/common.css b/css/common.css index 7553c0e..9f1a4ab 100644 --- a/css/common.css +++ b/css/common.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://notabug.org/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ diff --git a/css/dashboard-common.css b/css/dashboard-common.css index f138794..44ec471 100644 --- a/css/dashboard-common.css +++ b/css/dashboard-common.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -26,44 +26,44 @@ body { margin: 0; padding: 0 0.5em 0 0.5em; font: 15px/1.4 sans-serif; -} + } body > *:first-child { margin-top: 0; -} + } h2, h3 { margin: 1em 0; font-family: sans-serif; -} + } h2 { font-size: 18px; -} + } h2:nth-of-type(1) { margin-top: 0; -} + } h3 { font-size: 16px; -} + } h2 + * { padding: 0; -} + } html.ltr h2 + * { margin: 0 0 0 1em; -} + } html.rtl h2 + * { margin: 0 1em 0 0; -} + } a { text-decoration: none; -} + } button { padding: 0.3em 0.5em; -} + } input[disabled] + label { color: gray; -} + } .para { width: 40em; -} + } .whatisthis { margin: 0 0 0 8px; @@ -72,13 +72,13 @@ input[disabled] + label { padding: 0 0 4px 0; cursor: pointer; opacity: 0.4; -} + } .whatisthis:before { content: '\f059'; -} + } .whatisthis:hover { opacity: 1.0; -} + } .whatisthis-expandable { background-color: #F8F8F8; border: 1px dotted #aaa; @@ -87,19 +87,19 @@ input[disabled] + label { margin: 0.5em 0 1em 1.25em; padding: 0.5em; white-space: pre-line; -} + } .whatisthis-expandable > p { margin-top: 1em; margin-bottom: 0; -} + } .whatisthis-expandable > p:first-child { margin-top: 0; -} + } .whatisthis-expandable.whatisthis-expanded { display: block; -} + } .warn { margin: 0; padding: 5px; background-color: #FEDAE0; -} + } diff --git a/css/dashboard.css b/css/dashboard.css index 67a266f..8198ac9 100644 --- a/css/dashboard.css +++ b/css/dashboard.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -29,7 +29,7 @@ body { width: 100vw; height: 100vh; overflow: hidden; -} + } #dashboard-nav { margin: 0; border: 0; @@ -39,18 +39,18 @@ body { width: 100vw; height: 50px; z-index: 10; -} + } #dashboard-nav-widgets { margin: 0; border-bottom: 1px solid #ccc; padding: 4px 0 0 0; white-space: nowrap; background-color: white; -} + } #dashboard-nav-widgets span { padding: 0 0.5em; font-size: larger; -} + } .tabButton { margin: 0; border: 1px solid #ccc; @@ -65,17 +65,17 @@ body { font: inherit; cursor: pointer; text-decoration: none; -} + } .tabButton:focus { outline: 0; -} + } .tabButton:active,.tabButton:visited { color: inherited; -} + } .tabButton.selected { border-bottom: 1px solid white; background-color: white; -} + } iframe { margin: 0; border: 0; @@ -86,4 +86,4 @@ iframe { top: 50px; width: 100%; height: calc(100% - 50px); -} + } diff --git a/css/hosts-files.css b/css/hosts-files.css index fa3e07b..8c71ad8 100644 --- a/css/hosts-files.css +++ b/css/hosts-files.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -29,74 +29,74 @@ 67.5% { transform: rotate(225deg); -webkit-transform: rotate(225deg); } 75% { transform: rotate(270deg); -webkit-transform: rotate(270deg); } 87.5% { transform: rotate(315deg); -webkit-transform: rotate(315deg); } -} + } ul { padding: 0; list-style-type: none; -} + } ul#options { margin-top: 0; -} + } ul#options li { margin-bottom: 0.5em; -} + } ul#lists { margin: 0.5em 0 0 0; padding: 0; -} + } li.listEntry { margin: 0 auto 0 auto; padding: 0.2em 0; -} + } body[dir="ltr"] li.listEntry { margin-left: 1em; margin-right: 0em; -} + } body[dir="rtl"] li.listEntry { margin-left: 0em; margin-right: 1em; -} + } li.listEntry > * { margin-right: 0.5em; text-indent: 0; unicode-bidi: embed; -} + } li.listEntry > a:nth-of-type(2) { font-size: 13px; opacity: 0.5; -} + } li.listEntry.toRemove > input[type="checkbox"] { visibility: hidden; -} + } li.listEntry.toRemove > a.content { text-decoration: line-through; -} + } li.listEntry > .fa { color: inherit; display: none; font-size: 110%; opacity: 0.5; vertical-align: baseline; -} + } li.listEntry > a.fa:hover { opacity: 1; -} + } li.listEntry.support > a.support { display: inline-block; -} + } li.listEntry > a.remove, li.listEntry > a.remove:visited { color: darkred; -} + } li.listEntry.external > a.remove { display: inline-block; -} + } li.listEntry.mustread > a.mustread { display: inline-block; -} + } li.listEntry.mustread > a.mustread:hover { color: mediumblue; -} + } li.listEntry > .counts { display: none; font-size: smaller; @@ -111,54 +111,54 @@ li.listEntry span.status { } li.listEntry span.status:hover { opacity: 1; -} + } li.listEntry span.unsecure { - color: darkred; -} + color: #444; + } li.listEntry.unsecure > input[type="checkbox"]:checked ~ span.unsecure { display: inline-block; -} + } li.listEntry span.failed { color: darkred; -} + } li.listEntry.failed span.failed { display: inline-block; -} + } li.listEntry span.cache { cursor: pointer; -} + } li.listEntry.cached:not(.obsolete) > input[type="checkbox"]:checked ~ span.cache { display: inline-block; -} + } li.listEntry span.obsolete { color: hsl(36, 100%, 40%); -} + } body:not(.updating) li.listEntry.obsolete > input[type="checkbox"]:checked ~ span.obsolete { display: inline-block; -} + } li.listEntry span.updating { transform-origin: 50% 46%; -} + } body.updating li.listEntry.obsolete > input[type="checkbox"]:checked ~ span.updating { animation: spin 1s step-start infinite; display: inline-block; -} + } .dim { opacity: 0.5; -} + } #externalLists { margin: 2em auto 0 auto; -} + } body[dir="ltr"] #externalListsDiv { margin-left: 1em; -} + } body[dir="rtl"] #externalListsDiv { margin-right: 1em; -} + } #externalHostsFiles { box-sizing: border-box; font-size: smaller; width: 100%; height: 12em; white-space: pre; -} + } diff --git a/css/legacy-toolbar-button.css b/css/legacy-toolbar-button.css index b3cbd8a..03411ed 100644 --- a/css/legacy-toolbar-button.css +++ b/css/legacy-toolbar-button.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ diff --git a/css/logger-ui.css b/css/logger-ui.css index 41448a7..387b3ff 100644 --- a/css/logger-ui.css +++ b/css/logger-ui.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -30,7 +30,7 @@ body { overflow-x: hidden; padding: 0; width: 100%; -} + } #toolbar { background-color: white; border: 0; @@ -44,7 +44,7 @@ body { top: 0; width: 100%; z-index: 10; -} + } #toolbar .button { background-color: white; border: none; @@ -55,53 +55,53 @@ body { font-size: 150%; margin: 0; padding: 8px; -} + } #toolbar .button.disabled { opacity: 0.2; pointer-events: none; -} + } #toolbar .button:hover { background-color: #eee; -} + } #toolbar > div { white-space: nowrap; -} + } #toolbar > div:first-of-type { font-size: 120%; -} + } #toolbar > div > * { vertical-align: middle; -} + } #pageSelector { width: 28em; padding: 0.2em 0; -} + } body #compactViewToggler.button:before { content: '\f102'; -} + } body.compactView #compactViewToggler.button:before { content: '\f103'; -} + } #filterButton { opacity: 0.25; -} + } body.f #filterButton { opacity: 1; -} + } #filterInput.bad { background-color: #fee; -} + } #maxEntries { margin: 0 2em; -} + } input:focus { background-color: #ffe; -} + } #content { font-family: "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; font-size: 13px; width: 100%; -} + } #content table { border: 0; @@ -109,43 +109,43 @@ input:focus { direction: ltr; table-layout: fixed; width: 100%; -} + } #content table > colgroup > col:nth-of-type(1) { width: 4.6em; -} + } #content table > colgroup > col:nth-of-type(2) { width: 2.2em; -} + } #content table > colgroup > col:nth-of-type(3) { width: 2.2em; -} + } #content table > colgroup > col:nth-of-type(4) { width: 5.4em; -} + } #content table > colgroup > col:nth-of-type(5) { width: calc(100% - 14.4em); -} + } #content table tr { background-color: #fafafa; -} + } body.f table tr.f { display: none; -} + } #content table tr:nth-of-type(2n+1) { background-color: #eee; -} + } #content table tr.cat_info { color: #00f; -} + } #content table tr.blocked { color: #f00; -} + } #content table tr.doc { background-color: #666; color: white; text-align: center; -} + } body #content td { border: 1px solid #ccc; @@ -155,61 +155,61 @@ body #content td { white-space: normal; word-break: break-all; word-wrap: break-word; -} + } #content table tr td:first-of-type { border-left: none; -} + } #content table tr td:last-of-type { border-right: none; -} + } body.compactView #content tr:not(.vExpanded) td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -} + } #content table tr td:nth-of-type(1) { cursor: default; text-align: right; white-space: nowrap; -} + } #content table tr td:nth-of-type(2) { text-align: center; white-space: nowrap; -} + } #content table tr.tab_bts > td:nth-of-type(2):before { content: '\f070'; font: 1em FontAwesome; -} + } #content table tr.tab:not(.canMtx) { opacity: 0.3; -} + } #content table tr.tab:not(.canMtx):hover { opacity: 0.7; -} + } #content table tr.tab:not(.canMtx) > td:nth-of-type(2):before { content: '\f00d'; font: 1em FontAwesome; -} + } body:not(.popupOn) #content table tr.canMtx td:nth-of-type(2) { cursor: zoom-in; -} + } body:not(.popupOn) #content table tr.canMtx td:nth-of-type(2):hover { background: #ccc; -} + } #content table tr.cat_net td:nth-of-type(3) { font: 12px monospace; text-align: center; white-space: nowrap; -} + } #content table tr.cat_net td:nth-of-type(5) { -} + } #content table tr.cat_net td:nth-of-type(5) > span > * { opacity: 0.6; -} + } #content table tr.cat_net td:nth-of-type(5) > span > b:first-of-type { opacity: 1; -} + } #popupContainer { background: white; @@ -220,36 +220,36 @@ body:not(.popupOn) #content table tr.canMtx td:nth-of-type(2):hover { right: 1em; top: 0; z-index: 200; -} + } body.popupOn #popupContainer { display: block; -} + } #popupContainer > div { background: #888; border: 0; -} + } #popupContainer > div { text-align: right; -} + } #popupContainer > div > span { color: #ccc; cursor: pointer; display: inline-block; font: 14px FontAwesome; padding: 3px; -} + } #popupContainer > div > span:hover { color: white; -} + } #popupContainer > iframe { border: 0; padding: 0; margin: 0; width: 100%; -} + } #popupContainer.hide { width: 6em !important; -} + } #popupContainer.hide > iframe { display: none; -} + } diff --git a/css/popup.css b/css/popup.css index a070e1d..9f466f2 100644 --- a/css/popup.css +++ b/css/popup.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -33,19 +33,19 @@ body { overflow-y: auto; padding: 0; position: relative; -} + } *:focus { outline: none; -} + } a { color: inherit; text-decoration: none; -} + } #version { font-size: 10px; font-weight: normal; -} + } #gotoDashboard { background-color: #444; border: 0; @@ -58,17 +58,17 @@ a { padding: 3px 0; position: relative; text-align: center; -} + } #gotoDashboard > span:last-of-type { opacity: 0.5; position: absolute; -} + } body[dir="ltr"] #gotoDashboard > span:last-of-type { left: 3px; -} + } body[dir="rtl"] #gotoDashboard > span:last-of-type { right: 3px; -} + } .paneHead { background-color: white; @@ -78,10 +78,10 @@ body[dir="rtl"] #gotoDashboard > span:last-of-type { right: 0; top: 0; z-index: 100; -} + } .paneContent { padding-top: 5.5em; -} + } .paneHead > a:first-child { @@ -96,7 +96,7 @@ body[dir="rtl"] #gotoDashboard > span:last-of-type { margin: 0; padding: 2px 0; text-align: center; -} + } #toolbarContainer { display: flex; justify-content: space-between; @@ -106,7 +106,7 @@ body[dir="rtl"] #gotoDashboard > span:last-of-type { display: inline-flex; margin: 0; padding: 0; -} + } body .toolbar button { background-color: white; @@ -116,69 +116,69 @@ body .toolbar button { margin: 0; padding: 0.2em 0.2em 0.1em 0.2em; position: relative; -} + } body .toolbar button:hover { background-color: #eee; -} + } body .toolbar button.disabled { color: #ccc; -} + } body .toolbar button.fa { font: 1.7em FontAwesome; min-width: 1.4em; -} + } #mtxSwitch_matrix-off.switchTrue { color: #a00; -} + } #mtxSwitches > li { align-items: center; color: #888; display: flex; -} + } #mtxSwitches > li.switchTrue { color: #000; -} + } #mtxSwitches > li > svg { display: inline; height: 1em; margin-right: 0.4em; width: 1.5em; -} + } #mtxSwitches > li > svg * { fill-opacity: 1; opacity: 1; stroke: none; -} + } #mtxSwitches > li.relevant > svg .dot { fill: #aaa; -} + } #mtxSwitches > li.switchTrue.relevant > svg .dot { fill: #eee; -} + } #mtxSwitches > li > svg .off, #mtxSwitches > li.switchTrue > svg .on, #mtxSwitches > li.relevant > svg .dot { display: block; -} + } #mtxSwitches > li > svg .on, #mtxSwitches > li > svg .dot, #mtxSwitches > li.switchTrue > svg .off { display: none; -} + } #mtxSwitches > li > span[data-i18n] { flex-grow: 1; -} + } #mtxSwitches > li > a { color: #000; opacity: 0; -} + } #mtxSwitches > li:hover > a { opacity: 0.1; -} + } #mtxSwitches > li > a:hover { opacity: 0.8; -} + } .dropdown-menu-capture { background-color: transparent; @@ -192,10 +192,10 @@ body .toolbar button.fa { right: 0; top: 0; z-index: 300; -} + } .dropdown-menu-capture.show { display: block; -} + } .dropdown-menu { border: 0; display: inline-block; @@ -203,7 +203,7 @@ body .toolbar button.fa { padding: 3px 0 0 0; position: absolute; white-space: normal; -} + } .dropdown-menu > ul { margin: 0; border: 0; @@ -212,7 +212,7 @@ body .toolbar button.fa { padding: 0; background-color: white; list-style-type: none; -} + } .dropdown-menu > ul > li.dropdown-menu-entry { border: 0; color: black; @@ -220,21 +220,21 @@ body .toolbar button.fa { margin: 0; padding: 0.2em 0.25em; white-space: nowrap; -} + } .dropdown-menu > ul > li.dropdown-menu-entry:hover { background: #eee; -} + } .dropdown-menu > ul > li.dropdown-menu-entry-divider { border-top: 1px solid #ccc; margin: 0.5em 0; -} + } .dropdown-menu.show { display: block; -} + } #buttonReload { margin-left: 1em; -} + } button > span.badge { padding: 1px 1px; @@ -245,19 +245,19 @@ button > span.badge { bottom: 1px; color: #000; background-color: rgba(240,240,240,0.75) -} + } button.disabled > span.badge { display: none; -} + } #buttonPresets + .dropdown-menu { position: fixed; left: 10vw; width: 80vw; -} + } .presetInfo { margin: 0.25em 0.5em; text-align: center; -} + } .presetEntry { margin: 0.25em 0.25em; border-radius: 3px; @@ -265,14 +265,14 @@ button.disabled > span.badge { display: inline-block; cursor: pointer; background-color: #eee; -} + } .presetEntry .fa { margin-right: 0.25em; font-size: 110%; -} + } .presetEntry:hover { background-color: #80e2ff; -} + } #presetMore > *:first-child { margin: 0; padding: 0; @@ -280,19 +280,19 @@ button.disabled > span.badge { color: #888; cursor: pointer; font-size: 13px; -} + } #presetMore > *:first-child + div { margin: 0.25em 0 0 0; padding: 0.25em 0 0 0; display: none; text-align: center; -} + } #presetMore > *:first-child + div.show { display: block; -} + } #presetMore > *:first-child + div > * { vertical-align: middle; -} + } #presetMoreRecipe { border: 1px solid #aaa; width: 75%; @@ -301,20 +301,20 @@ button.disabled > span.badge { resize: none; font-size: 10px; color: #888; -} + } #presetMoreRecipe.bad { border: 1px solid #fcc; color: #aaa; -} + } #presetMoreWrite.bad { visibility: hidden; -} + } /* I think this is obsolete */ .dropdown-menu > li > a > i { padding: 0 6px; font-size: 1.2em; -} + } body .toolbar .scope { background-color: #ccc; @@ -326,75 +326,75 @@ body .toolbar .scope { margin: 0; padding: 1px; cursor: pointer; -} + } body .toolbar .scope > span { align-items: center; display: inline-flex; -} + } body .toolbar .scope > span > span { pointer-events: none; white-space: nowrap; -} + } body .toolbar #specificScope { direction: ltr; justify-content: flex-end; width: 16em; -} + } body .toolbar #specificScope.on { background-color: #24c; border-color: #24c; -} + } body .toolbar #specificScope > span { background-color: #ccc; justify-content: flex-end; -} + } body .toolbar #specificScope > span.on { background-color: #24c; -} + } body .toolbar #specificScope > span:first-of-type:not(.on):hover, body .toolbar #specificScope > span:first-of-type:not(.on):hover ~ span:not(.on), body .toolbar #specificScope > span:not(.on) + span:not(.on):hover, body .toolbar #specificScope > span:not(.on) + span:not(.on):hover ~ span:not(.on) { background-color: #999; -} + } body .toolbar #specificScope > span:first-of-type:not(.on):hover ~ span, body .toolbar #specificScope > span:not(.on) + span:not(.on):hover ~ span, body .toolbar #specificScope > span.on + span:hover, body .toolbar #specificScope > span.on + span:hover ~ span { background-color: #139; -} + } body .toolbar #specificScope > span:first-of-type { flex: 1; -} + } body .toolbar #globalScope { justify-content: center; margin-left: 1px; width: 1.8em; -} + } body .toolbar #globalScope.on { background-color: #000; border-color: #000; -} + } body .toolbar #globalScope:not(.on):hover { background-color: #999; border-color: #999; -} + } body .toolbar .scopeRel { color: #24c; -} + } body.globalScope .toolbar .scopeRel { color: #000; -} + } body.globalScope .toolbar .scopeRel.disabled { color: #ccc; -} + } .matrix { text-align: left; -} + } .matRow { white-space: nowrap; -} + } .matCell { margin: 1px 1px 0 0; border: 1px dotted rgba(0,0,0,0.2); @@ -407,23 +407,23 @@ body.globalScope .toolbar .scopeRel.disabled { text-align: center; line-height: 110%; position: relative; -} + } #matHead { border-top: 1px dotted #ccc; padding-top: 1px; margin: 1px 0 0 0; -} + } .paneHead .matCell:nth-child(2) { letter-spacing: -0.3px; -} + } .paneContent .matrix .matRow > .matCell:first-child { font-weight: 100; -} + } .paneContent .matrix .matRow > .matCell:first-child > b { font-weight: normal; -} + } /* RFC 3987 Internationalized Resource Identifiers (IRIs) -- 4.4 */ .matrix .matRow > .matCell:first-child { @@ -431,42 +431,42 @@ body.globalScope .toolbar .scopeRel.disabled { text-align: right; unicode-bidi: embed; width: 16em; -} + } .matrix .matGroup.g4 .matRow.ro > .matCell:first-child { direction: inherit; -} + } .matrix .matRow.l2 > .matCell:first-child { margin-left: 1px; width: calc(16em - 1px); -} + } .matrix .matRow > .matCell:hover { border-style: solid; -} + } .matrix .matGroup .matSection { margin: 2px 0 0 0; border: 0; padding: 0; /* background-color: rgba(0,0,0,0.05); */ -} + } .matrix .matGroup.g0 .matSection:first-child { margin-top: 0; -} + } .matrix .matGroup.g4 .matSection:first-child { margin-top: 0; -} + } /* Collapsing of domains */ .matrix .matSection .matRow.meta { display: none; -} + } .matrix .matSection.collapsible.collapsed .matRow.meta { display: block; -} + } .matrix .matSection.collapsible.collapsed .matRow.l1:not(.meta) { display: none; -} + } .matrix .matSection.collapsible.collapsed .matRow.l2.collapsible { display: none; -} + } /* Collapsing of blacklisted */ .matrix .g4Meta { @@ -475,106 +475,106 @@ body.globalScope .toolbar .scopeRel.disabled { border: 0; height: 6px; background: url('../img/matrix-group-hide.png') no-repeat center top, - url('../img/matrix-group-hline.png') repeat-x center top 3px; + url('../img/matrix-group-hline.png') repeat-x center top 3px; opacity: 0.2; cursor: pointer; -} + } .matrix .g4Meta:hover { opacity: 0.4; -} + } .matrix .g4Meta.g4Collapsed { background: url('../img/matrix-group-show.png') no-repeat center top, - url('../img/matrix-group-hline.png') repeat-x center top 3px; -} + url('../img/matrix-group-hline.png') repeat-x center top 3px; + } .matrix .g4Meta.g4Collapsed ~ .matSection { display: none; -} + } body.powerOff .matrix .g4Meta.g4Collapsed ~ .matSection { display: block; -} + } .matrix .g4Meta ~ .matRow.ro { display: none; -} + } .matrix .g4Meta.g4Collapsed ~ .matRow.ro { display: block; -} + } body.powerOff .matrix .g4Meta.g4Collapsed ~ .matRow.ro { display: none; -} + } .matrix .matGroup .g4Meta + *,.matrix .matGroup .g4Meta + * + * { margin-top: 0; padding-top: 0; -} + } /* Cell coloring */ .t81 { color: white; background-color: #c00; -} + } .t82 { color: white; background-color: #080; -} + } .t1 { border-color: #debaba; color: black; background-color: #f8d0d0; -} + } .t2 { border-color: #bad6ba; color: black; background-color: #d0f0d0; -} + } .matCell.p81 { background-image: url('../img/permanent-black-small.png'); background-repeat: no-repeat; background-position: -1px -1px; -} + } .matCell.p82 { background-image: url('../img/permanent-white-small.png'); background-repeat: no-repeat; background-position: -1px -1px; -} + } /* Cell coloring for color blind-friendly (hopefully) */ body.colorblind .t81 { color: white; background-color: rgb(0, 19, 110); -} + } body.colorblind .t82 { border-color: rgb(255, 194, 57); color: black; background-color: rgb(255, 194, 57); -} + } body.colorblind .t1 { border-color: rgba(0, 19, 110, 0.3); color: black; background-color: rgba(0, 19, 110, 0.2); -} + } body.colorblind .t2 { border-color: rgba(255, 194, 57, 0.3); color: black; background-color: rgba(255, 194, 57, 0.2); -} + } body.colorblind .matCell.p81 { background-image: url('../img/permanent-black-small-cb.png'); -} + } body.colorblind .matCell.p82 { background-image: url('../img/permanent-white-small-cb.png'); -} + } .matRow.rw .matCell { cursor: pointer; -} + } body.powerOff .matRow.rw .matCell { cursor: auto; opacity: 0.6; -} + } .top { font-weight: bold; -} + } #cellHotspots { margin: 0; @@ -586,7 +586,7 @@ body.powerOff .matRow.rw .matCell { width: 100%; height: 100%; z-index: 10; -} + } #whitelist, #blacklist { margin: 0; border: 0; @@ -596,54 +596,54 @@ body.powerOff .matRow.rw .matCell { width: 100%; height: 50%; background: transparent; -} + } #whitelist { top: 0; -} + } #blacklist { top: 50%; -} + } body.powerOff #whitelist, body.powerOff #blacklist { display: none; -} + } .rw .matCell.t1 #whitelist:hover { background-color: #080; opacity: 0.25; -} + } body.colorblind .rw .matCell.t1 #whitelist:hover, body.colorblind .rw .matCell.t2 #whitelist:hover { background-color: rgb(255, 194, 57); opacity: 0.6; -} + } .rw .matCell.t2 #whitelist:hover { background-color: #080; opacity: 0.25; -} + } .matCell.t81 #whitelist:hover { background-color: transparent; -} + } .matCell.t82 #whitelist:hover { background-color: transparent; -} + } .rw .matCell.t1 #blacklist:hover { background-color: #c00; opacity: 0.25; -} + } body.colorblind .rw .matCell.t1 #blacklist:hover, body.colorblind .rw .matCell.t2 #blacklist:hover { background-color: rgb(0, 19, 110); opacity: 0.4; -} + } .rw .matCell.t2 #blacklist:hover { background-color: #c00; opacity: 0.25; -} + } .matCell.t81 #blacklist:hover { background-color: transparent; -} + } .matCell.t82 #blacklist:hover { background-color: transparent; -} + } #domainOnly { margin: 0; border: 1px solid gray; @@ -659,35 +659,35 @@ body.colorblind .rw .matCell.t2 #blacklist:hover { opacity: 0.25; z-index: 10000; cursor: pointer; -} + } .matSection #domainOnly .fa:before { content: '\f106'; -} + } .matSection.collapsed #domainOnly .fa:before { content: '\f107'; -} + } .matSection.collapsible .matRow.l1 .matCell:nth-of-type(1):hover #domainOnly { display: block; -} + } #matHead #domainOnly .fa:before { content: '\f106'; -} + } #matHead.collapsed #domainOnly .fa:before { content: '\f107'; -} + } #matHead.collapsible .matRow .matCell:nth-of-type(1):hover #domainOnly { display: block; -} + } #domainOnly:hover { opacity: 1; -} + } /* No data was found for the tab */ body.noTabFound .paneHead, body.noTabFound .paneContent { display: none; -} + } body.noTabFound #noTabFound { align-items: center; color: gray; @@ -695,19 +695,19 @@ body.noTabFound #noTabFound { font-size: xx-large; height: 100vh; justify-content: center; -} + } /* Mobile-friendly rules */ body.hConstrained { overflow-x: auto; -} + } body.hConstrained .paneHead { left: auto; position: absolute; right: auto; width: 100%; -} + } body[data-touch="true"] .matCell { line-height: 200%; -} + } diff --git a/css/raw-settings.css b/css/raw-settings.css index 77b76e2..fa2386d 100644 --- a/css/raw-settings.css +++ b/css/raw-settings.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -25,10 +25,10 @@ body { flex-direction: column; height: 100vh; justify-content: space-between; -} + } p { margin: 0.5em 0; -} + } textarea { box-sizing: border-box; flex-grow: 1; @@ -37,4 +37,4 @@ textarea { white-space: pre; width: 100%; word-wrap: normal; -} + } diff --git a/css/user-rules.css b/css/user-rules.css index ad02f2f..acdf422 100644 --- a/css/user-rules.css +++ b/css/user-rules.css @@ -1,7 +1,7 @@ /******************************************************************************* ηMatrix - a browser extension to black/white list requests. - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -16,16 +16,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ div > p:first-child { margin-top: 0; -} + } div > p:last-child { margin-bottom: 0; -} + } #diff { border: 0; margin: 0; @@ -42,14 +42,14 @@ div > p:last-child { vertical-align: top; white-space: normal; width: calc(50% - 2px); -} + } #diff > .pane > div { padding: 0 0 1em 0; text-align: center; -} + } #diff > .pane > div > span { float: left; -} + } body[dir="ltr"] #revertButton:after { content: '\2009\f061'; font-family: FontAwesome; @@ -58,7 +58,7 @@ body[dir="ltr"] #revertButton:after { line-height: 1; vertical-align: baseline; display: inline-block; -} + } body[dir="rtl"] #revertButton:after { content: '\2009\f060'; font-family: FontAwesome; @@ -67,7 +67,7 @@ body[dir="rtl"] #revertButton:after { line-height: 1; vertical-align: baseline; display: inline-block; -} + } body[dir="ltr"] #commitButton:before { content: '\f060\2009'; font-family: FontAwesome; @@ -76,7 +76,7 @@ body[dir="ltr"] #commitButton:before { line-height: 1; vertical-align: baseline; display: inline-block; -} + } body[dir="rtl"] #commitButton:before { content: '\f061\2009'; font-family: FontAwesome; @@ -85,30 +85,30 @@ body[dir="rtl"] #commitButton:before { line-height: 1; vertical-align: baseline; display: inline-block; -} + } #revertButton, #commitButton, #diff.edit #editEnterButton { opacity: 0.25; pointer-events: none; -} + } #editStopButton, #editCancelButton { display: none; -} + } #diff.dirty:not(.edit) #revertButton, #diff.dirty:not(.edit) #commitButton { opacity: 1; pointer-events: auto; -} + } #diff.edit #editStopButton, #diff.edit #editCancelButton { display: initial; -} + } #diff.edit #importButton, #diff.edit #exportButton { display: none; -} + } #diff ul { border: 0; border-top: 1px solid #eee; @@ -116,50 +116,50 @@ body[dir="rtl"] #commitButton:before { margin: 0; overflow: hidden; padding: 1em 0 0 0; -} + } #diff ul, #diff textarea { font: 12px/1.8 monospace; -} + } #diff.edit .right ul { visibility: hidden; -} + } #diff .left { padding: 0 0 0 0; -} + } #diff .right > ul { color: #888; -} + } #diff li { background-color: white; direction: ltr; padding: 0; text-align: left; white-space: nowrap; -} + } #diff li:nth-of-type(2n+0) { background-color: #eee; -} + } #diff .right li { cursor: pointer; -} + } #diff .right li:hover { background-color: #ffc; color: #000; -} + } #diff .right li.notLeft { color: #000; -} + } #diff .right li.notLeft:hover { text-decoration: line-through; -} + } #diff .right li.notRight { color: #000; -} + } #diff .right li.toRemove { color: #000; text-decoration: line-through; -} + } #diff textarea { border: 0; border-top: 1px solid #eee; @@ -175,10 +175,10 @@ body[dir="rtl"] #commitButton:before { visibility: hidden; white-space: pre; width: 100%; -} + } #diff.edit textarea { visibility: visible; -} + } .hidden { display: none; -} + } diff --git a/frameScript.js b/frameScript.js index f8acc54..bdd274d 100644 --- a/frameScript.js +++ b/frameScript.js @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2014-2019 The µBlock authors - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -29,35 +29,35 @@ var locationChangeListener; // Keep alive while frameScript is alive (function () { let injectContentScripts = function (win) { - if (!win || !win.document) { + if (!win || !win.document) { return; - } + } - contentObserver.observe(win.document); + contentObserver.observe(win.document); - if (win.frames && win.frames.length) { - for (let i = win.frames.length; i>0; --i) { - injectContentScripts(win.frames[i]); + if (win.frames && win.frames.length) { + for (let i = win.frames.length; i>0; --i) { + injectContentScripts(win.frames[i]); } - } + } }; let onLoadCompleted = function () { - removeMessageListener('ematrix-load-completed', onLoadCompleted); - injectContentScripts(content); + removeMessageListener('ematrix-load-completed', onLoadCompleted); + injectContentScripts(content); }; addMessageListener('ematrix-load-completed', onLoadCompleted); if (docShell) { - let Ci = Components.interfaces; - let wp = docShell - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebProgress); - let dw = wp.DOMWindow; + let Ci = Components.interfaces; + let wp = docShell + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebProgress); + let dw = wp.DOMWindow; - if (dw === dw.top) { + if (dw === dw.top) { locationChangeListener = new LocationChangeListener(docShell); - } + } } })(); diff --git a/install.rdf b/install.rdf index 7943ccd..858e97e 100644 --- a/install.rdf +++ b/install.rdf @@ -22,7 +22,7 @@ eMatrix@vannilla.org - 3.1.2 + 3.1.3 ηMatrix Point & click to forbid/allow any class of requests made by your browser. Use it to block scripts, iframes, ads, facebook, etc. diff --git a/js/about.js b/js/about.js index a35b45c..9ada80e 100644 --- a/js/about.js +++ b/js/about.js @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2014-2019 Raymond Hill - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 diff --git a/js/asset-viewer.js b/js/asset-viewer.js index 8998892..12f0e3b 100644 --- a/js/asset-viewer.js +++ b/js/asset-viewer.js @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2014-2019 Raymond Hill - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -36,7 +36,7 @@ } vAPI.messaging.send('asset-viewer.js', { - what : 'getAssetContent', - url: matches[1] + what : 'getAssetContent', + url: matches[1] }, onAssetContentReceived); })(); diff --git a/js/assets.js b/js/assets.js index 286cf0d..9bb2470 100644 --- a/js/assets.js +++ b/js/assets.js @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2013-2019 Raymond Hill - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -17,14 +17,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ 'use strict'; -/******************************************************************************/ - ηMatrix.assets = (function() { let api = {}; @@ -33,21 +31,21 @@ let connectionError = vAPI.i18n('errorCantConnectTo'); let notifyObservers = function (topic, details) { - let result; + let result; - for (let i=0; i 0) { - vAPI.cacheStorage.remove(removedContent); + if (contents.length !== 0) { + vAPI.cacheStorage.remove(contents); - let bin = { - assetCacheRegistry: cacheRegistry, - }; + let bin = { + assetCacheRegistry: cache, + }; + vAPI.cacheStorage.set(bin); + } - vAPI.cacheStorage.set(bin); - } + if (typeof callback === 'function') { + callback(); + } - if (typeof callback === 'function') { - callback(); - } + for (let i=0; i now) { - continue; - } - if (notifyObservers('before-asset-updated', {assetKey: key})) { - return key; - } - - gcOne(key); - } - - return undefined; - }; - - let onUpdate = function (details) { - if (details.content !== '') { - updated.push(details.assetKey); - if (details.assetKey === 'assets.json') { - updateSourceRegistry(details.content); - } - } else { - notifyObservers('asset-update-failed', { - assetKey: details.assetKey, - }); - } - - if (findOne() !== undefined) { - vAPI.setTimeout(updateNext, updateDelay); - } else { - updateEnd(); - } - }; - - let updateOne = function () { - let key = findOne(); - if (key === undefined) { - updateEnd(); - return; - } - - updateFetch.add(key); - getRemote(key, onUpdate); - }; - - let onSourceReady = function (registry) { - sourceReg = registry; - updateOne(); - }; - - let onCacheReady = function (registry) { - cacheReg = registry; - getSourceRegistry(onSourceReady); - }; - - getCacheRegistry(onCacheReady); + let cacheReg = undefined; + let sourceReg = undefined; + + let gcOne = function (key) { + let entry = cacheReg[key]; + if (entry && entry.readTime < cacheRegistryStart) { + removeCache(key); + } + }; + + let findOne = function () { + let now = Date.now(); + let sourceEntry; + let cacheEntry; + + for (let key in sourceReg) { + sourceEntry = sourceReg[key]; + if (sourceEntry.hasRemoteURL !== true) { + continue; + } + if (updateFetch.has(key)) { + continue; + } + + cacheEntry = cacheReg[key]; + if (cacheEntry + && (cacheEntry.writeTime + + sourceEntry.updateAfter*86400000) > now) { + continue; + } + if (notifyObservers('before-asset-updated', {assetKey: key})) { + return key; + } + + gcOne(key); + } + + return undefined; + }; + + let onUpdate = function (details) { + if (details.content !== '') { + updated.push(details.assetKey); + if (details.assetKey === 'assets.json') { + updateSourceRegistry(details.content); + } + } else { + notifyObservers('asset-update-failed', { + assetKey: details.assetKey, + }); + } + + if (findOne() !== undefined) { + vAPI.setTimeout(updateNext, updateDelay); + } else { + updateEnd(); + } + }; + + let updateOne = function () { + let key = findOne(); + if (key === undefined) { + updateEnd(); + return; + } + + updateFetch.add(key); + getRemote(key, onUpdate); + }; + + let onSourceReady = function (registry) { + sourceReg = registry; + updateOne(); + }; + + let onCacheReady = function (registry) { + cacheReg = registry; + getSourceRegistry(onSourceReady); + }; + + getCacheRegistry(onCacheReady); }; let updateEnd = function () { - let keys = updated.slice(0); - updateFetch.clear(); - updateStatus = 'stop'; - updateDelay = updateDefaultDelay; - notifyObservers('after-asset-updated', { - assetKeys: keys, - }); + let keys = updated.slice(0); + updateFetch.clear(); + updateStatus = 'stop'; + updateDelay = updateDefaultDelay; + notifyObservers('after-asset-updated', { + assetKeys: keys, + }); }; // Assets API api.addObserver = function (observer) { - if (observers.indexOf(observer) === -1) { - observers.push(observer); - } + if (observers.indexOf(observer) === -1) { + observers.push(observer); + } }; api.removeObserver = function (observer) { - let pos = observers.indexOf(observer); - if (pos !== -1) { - observers.splice(pos, 1); - } + let pos = observers.indexOf(observer); + while (pos !== -1) { + observers.splice(pos, 1); + pos = observers.indexOf(observer); + } }; api.fetchText = function (url, onLoad, onError, tries) { - let iurl = externalPathRegex.test(url) ? url : vAPI.getURL(url); - let tr = (tries === undefined) ? 10 : tries; - - if (typeof onError !== 'function') { - onError = onLoad; - } - - let onResponseReceived = function () { - this.onload = this.onerror = this.ontimeout = null; - - let details = { - url: url, - content: '', - // On local files this.status is 0, but the request - // is successful - statusCode: this.status || 200, - statusText: this.statusText || '', - }; - - if (details.statusCode < 200 || details.statusCode >= 300) { - onError.call(null, details, tr); - return; - } - - if (isEmptyString(this.responseText) === true) { - onError.call(null, details, tr); - return; - } - - let t = this.responseText.trim(); - - // Discard HTML as it's probably an error - // (the request expects plain text as a response) - if (t.startsWith('<') && t.endsWith('>')) { - onError.call(null, details, tr); - return; - } - - details.content = t; - onLoad.call(null, details, tr); - }; - - let onErrorReceived = function () { - this.onload = this.onerror = this.ontimeout = null; - - ηMatrix.logger.writeOne('', 'error', - connectionError.replace('{{url}}', iurl)); - - onError.call(null, { - url: url, - content: '', - }, tr); - }; - - let req = new XMLHttpRequest(); - req.open('GET', iurl, true); - req.timeout = 30000; - req.onload = onResponseReceived; - req.onerror = onErrorReceived; - req.ontimeout = onErrorReceived; - req.responseType = 'text'; - - try { - // This can throw in some cases - req.send(); - } catch (e) { - onErrorReceived.call(req); - } + let iurl = externalPathRegex.test(url) ? url : vAPI.getURL(url); + let tr = (tries === undefined) ? 10 : tries; + + if (typeof onError !== 'function') { + onError = onLoad; + } + + let onResponseReceived = function () { + this.onload = this.onerror = this.ontimeout = null; + + let details = { + url: url, + content: '', + // On local files this.status is 0, but the request + // is successful + statusCode: this.status || 200, + statusText: this.statusText || '', + }; + + if (details.statusCode < 200 || details.statusCode >= 300) { + return onError.call(null, details, tr); + } + + if (isEmptyString(this.responseText) === true) { + return onError.call(null, details, tr); + } + + let t = this.responseText.trim(); + + // Discard HTML as it's probably an error + // (the request expects plain text as a response) + if (t.startsWith('<') && t.endsWith('>')) { + return onError.call(null, details, tr); + } + + details.content = t; + return onLoad.call(null, details, tr); + }; + + let onErrorReceived = function () { + this.onload = this.onerror = this.ontimeout = null; + + ηMatrix.logger.writeOne('', 'error', + connectionError.replace('{{url}}', iurl)); + + onError.call(null, { + url: url, + content: '', + }, tr); + }; + + let req = new XMLHttpRequest(); + req.open('GET', iurl, true); + req.timeout = 30000; + req.onload = onResponseReceived; + req.onerror = onErrorReceived; + req.ontimeout = onErrorReceived; + req.responseType = 'text'; + + try { + // This can throw in some cases + req.send(); + } catch (e) { + onErrorReceived.call(req); + } }; api.registerAssetSource = function (key, details) { - getSourceRegistry(function () { - registerSource(key, details); - saveSourceRegistry(true); - }); + getSourceRegistry(function () { + registerSource(key, details); + saveSourceRegistry(true); + }); }; api.unregisterAssetSource = function (key) { - getSourceRegistry(function () { - unregisterSource(key); - saveSourceRegistry(true); - }); + getSourceRegistry(function () { + unregisterSource(key); + saveSourceRegistry(true); + }); }; api.get = function (key, options, callback) { - let cb; - let opt; - - if (typeof options === 'function') { - cb = options; - opt = {}; - } else if (typeof callback !== 'function') { - cb = noOp; - opt = options; - } else { - cb = callback; - opt = options; - } - - let assetDetails = {}; - let contentUrl = undefined; - - let report = function (content, error) { - let details = { - assetKey: key, - content: content, - }; - - if (error) { - details.error = assetDetails.error = error; - } else { - assetDetails.error = undefined; - } - - cb(details); - }; - - let onContentNotLoaded = function (details, tries) { - let external; - let urls = []; - - let tr = (tries === undefined) ? 10 : tries; - - if (tr <= 0) { - console.warn('ηMatrix couldn\'t download the asset ' - +assetDetails.title); - return; - } - - if (typeof assetDetails.contentURL === 'string') { - urls = [assetDetails.contentURL]; - } else if (Array.isArray(assetDetails.contentURL)) { - urls = assetDetails.contentURL.slice(0); - } - - while ((contentUrl = urls.shift())) { - external = externalPathRegex.test(contentUrl); - if (external === true && assetDetails.loaded !== true) { - break; - } - if (external === false || assetDetails.hasLocalURL !== true) { - break; - } - } - - if (!contentUrl) { - report('', 'E_NOTFOUND'); - return; - } - - api.fetchText(contentUrl, onContentLoaded, onContentNotLoaded, - tr-1); - }; - - let onContentLoaded = function (details, tries) { - if (isEmptyString(details.content) === true) { - onContentNotLoaded(undefined, tries); - return; - } - - if (externalPathRegex.test(details.url) - && opt.dontCache !== true) { - writeCache(key, { - content: details.content, - url: contentUrl, - }); - } - - assetDetails.loaded = true; - - report(details.content); - }; - - let onCachedContentLoad = function (details) { - if (details.content !== '') { - report(details.content); - return; - } - - let onReady = function (registry) { - assetDetails = registry[key] || {}; - onContentNotLoaded(); - } - - getSourceRegistry(onReady); - }; - - readCache(key, onCachedContentLoad); + let cb; + let opt; + + if (typeof options === 'function') { + cb = options; + opt = {}; + } else if (typeof callback !== 'function') { + cb = noOp; + opt = options; + } else { + cb = callback; + opt = options; + } + + let assetDetails = {}; + let urls = []; + let contentUrl = ''; + + let report = function (content, error) { + let details = { + assetKey: key, + content: content, + }; + + if (error) { + details.error = assetDetails.error = error; + } else { + assetDetails.error = undefined; + } + + cb(details); + }; + + let onContentNotLoaded = function (details, tries) { + let external; + + let tr = (tries === undefined) ? 10 : tries; + + if (tr <= 0) { + console.warn('ηMatrix couldn\'t download the asset ' + +assetDetails.title); + return; + } + + while ((contentUrl = urls.shift())) { + external = externalPathRegex.test(contentUrl); + if (external === true && assetDetails.loaded !== true) { + break; + } + if (external === false || assetDetails.hasLocalURL !== true) { + break; + } + } + + if (!contentUrl) { + return report('', 'E_NOTFOUND'); + } + + api.fetchText(contentUrl, + onContentLoaded, + onContentNotLoaded, + tr-1); + }; + + let onContentLoaded = function (details, tries) { + if (isEmptyString(details.content) === true) { + return onContentNotLoaded(undefined, tries); + } + + if (externalPathRegex.test(details.url) + && opt.dontCache !== true) { + writeCache(key, { + content: details.content, + url: contentUrl, + }); + } + + assetDetails.loaded = true; + + report(details.content); + }; + + let onCachedContentLoad = function (details) { + if (details.content !== '') { + return report(details.content); + } + + let onRead = function (details) { + console.debug(details); + report(details.content || 'missing contents'); + } + + let onReady = function (registry) { + assetDetails = registry[key] || {}; + if (typeof assetDetails.contentURL === 'string') { + urls = [assetDetails.contentURL]; + } else if (Array.isArray(assetDetails.contentURL)) { + urls = assetDetails.contentURL.slice(0); + } + if (true === assetDetails.loaded) { + readCache(key, onRead); + } else { + onContentNotLoaded(); + } + } + + getSourceRegistry(onReady); + }; + + readCache(key, onCachedContentLoad); }; api.put = function (key, content, callback) { - writeCache(key, content, callback); + writeCache(key, content, callback); }; api.metadata = function (callback) { - let onSourceReady = function (registry) { - let source = JSON.parse(JSON.stringify(registry)); - let cache = cacheRegistry; - let sourceEntry; - let cacheEntry; - let now = Date.now(); - let obsoleteAfter; - - for (let key in source) { - sourceEntry = source[key]; - cacheEntry = cache[key]; - - if (cacheEntry) { - sourceEntry.cached = true; - sourceEntry.writeTime = cacheEntry.writeTime; - obsoleteAfter = cacheEntry.writeTime - + sourceEntry.updateAfter * 86400000; - sourceEntry.obsolete = obsoleteAfter < now; - sourceEntry.remoteURL = cacheEntry.remoteURL; - } else { - sourceEntry.writeTime = 0; - obsoleteAfter = 0; - sourceEntry.obsolete = true; - } - } - - callback(source); - } - - let onCacheReady = function () { - getSourceRegistry(onSourceReady); - } - - getCacheRegistry(onCacheReady); + let onSourceReady = function (registry) { + let source = JSON.parse(JSON.stringify(registry)); + let cache = cacheRegistry; + let sourceEntry; + let cacheEntry; + let now = Date.now(); + let obsoleteAfter; + + for (let key in source) { + sourceEntry = source[key]; + cacheEntry = cache[key]; + + if (cacheEntry) { + sourceEntry.cached = true; + sourceEntry.writeTime = cacheEntry.writeTime; + obsoleteAfter = cacheEntry.writeTime + + sourceEntry.updateAfter * 86400000; + sourceEntry.obsolete = obsoleteAfter < now; + sourceEntry.remoteURL = cacheEntry.remoteURL; + } else { + sourceEntry.writeTime = 0; + obsoleteAfter = 0; + sourceEntry.obsolete = true; + } + } + + callback(source); + } + + let onCacheReady = function () { + getSourceRegistry(onSourceReady); + } + + getCacheRegistry(onCacheReady); }; api.purge = function (pattern, exclude, callback) { - markDirtyCache(pattern, exclude, callback); + markDirtyCache(pattern, exclude, callback); }; api.remove = function (pattern, callback) { - cacheRemove(pattern, callback); + removeCache(pattern, callback); }; api.rmrf = function () { - cacheRemove(/./); + removeCache(/./); }; api.updateStart = function (details) { - let oldDelay = updateDelay; - let newDelay = details.delay || updateDefaultDelay; + let oldDelay = updateDelay; + let newDelay = details.delay || updateDefaultDelay; - updateDelay = Math.min(oldDelay, newDelay); + updateDelay = Math.min(oldDelay, newDelay); - if (updateStatus !== undefined) { - if (newDelay < oldDelay) { - clearTimeout(updateTimer); - updateTimer = vAPI.setTimeout(updateNext, updateDelay); - } - return; - } + if (updateStatus !== 'stop') { + if (newDelay < oldDelay) { + clearTimeout(updateTimer); + updateTimer = vAPI.setTimeout(updateNext, updateDelay); + } + return; + } - updateStart(); + updateStart(); }; api.updateStop = function () { - if (updateTimer) { - clearTimeout(updateTimer); - updateTimer = undefined; - } - if (updateStatus === 'running') { - updateEnd(); - } + if (updateTimer) { + clearTimeout(updateTimer); + updateTimer = undefined; + } + if (updateStatus === 'running') { + updateEnd(); + } }; api.checkVersion = function () { - let cache; - - let onSourceReady = function (registry) { - let source = JSON.parse(JSON.stringify(registry)); - let version = ηMatrix.userSettings.assetVersion; - - if (!version) { - ηMatrix.userSettings.assetVersion = 1; - version = 1; - } - - if (!source["assets.json"].version - || version > source["assets.json"].version) { - for (let key in source) { - switch (key) { - case "hphosts": - case "malware-0": - case "malware-1": - delete source[key]; - api.remove(key, function () {}); - break; - default: - break; - } - - source["assets.json"].version = version; - } - - let createRegistry = function () { - api.fetchText - (ηMatrix.assetsBootstrapLocation || 'assets/assets.json', - function (details) { - updateSourceRegistry(details.content, true); - }); - }; - - createRegistry(); - } - }; - - let onCacheReady = function (registry) { - cache = JSON.parse(JSON.stringify(registry)); - - getSourceRegistry(onSourceReady); - }; - - getCacheRegistry(onCacheReady); + let cache; + + let onSourceReady = function (registry) { + let source = JSON.parse(JSON.stringify(registry)); + let version = ηMatrix.userSettings.assetVersion; + + if (!version) { + ηMatrix.userSettings.assetVersion = 1; + version = 1; + } + + if (!source["assets.json"].version + || version > source["assets.json"].version) { + for (let key in source) { + switch (key) { + case "hphosts": + case "malware-0": + case "malware-1": + delete source[key]; + api.remove(key, function () {}); + break; + default: + break; + } + + source["assets.json"].version = version; + } + + let createRegistry = function () { + api.fetchText + (ηMatrix.assetsBootstrapLocation || 'assets/assets.json', + function (details) { + updateSourceRegistry(details.content, true); + }); + }; + + createRegistry(); + } + }; + + let onCacheReady = function (registry) { + cache = JSON.parse(JSON.stringify(registry)); + + getSourceRegistry(onSourceReady); + }; + + getCacheRegistry(onCacheReady); }; return api; })(); - -/******************************************************************************/ diff --git a/js/background.js b/js/background.js index 889decd..b31bbed 100644 --- a/js/background.js +++ b/js/background.js @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2014-2019 Raymond Hill - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni 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 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -32,45 +32,45 @@ var ηMatrix = (function () { let oneDay = 24 * oneHour; let _RequestStats = function () { - this.reset(); + this.reset(); }; _RequestStats.prototype.reset = function () { - this.all = - this.doc = - this.frame = - this.script = - this.css = - this.image = - this.media = - this.xhr = - this.other = - this.cookie = 0; + this.all = + this.doc = + this.frame = + this.script = + this.css = + this.image = + this.media = + this.xhr = + this.other = + this.cookie = 0; }; var RequestStats = function () { - this.allowed = new _RequestStats (); - this.blocked = new _RequestStats (); + this.allowed = new _RequestStats (); + this.blocked = new _RequestStats (); }; RequestStats.prototype.reset = function () { - this.blocked.reset(); - this.allowed.reset(); + this.blocked.reset(); + this.allowed.reset(); }; RequestStats.prototype.record = function (type, blocked) { - // Remember: always test against **false** - if (blocked !== false) { + // Remember: always test against **false** + if (blocked !== false) { this.blocked[type] += 1; this.blocked.all += 1; - } else { + } else { this.allowed[type] += 1; this.allowed.all += 1; - } + } }; var requestStatsFactory = function () { - return new RequestStats(); + return new RequestStats(); }; /** @@ -93,8 +93,8 @@ var ηMatrix = (function () { */ var rawSettingsDefault = { - disableCSPReportInjection: false, - placeholderBackground: [ + disableCSPReportInjection: false, + placeholderBackground: [ 'url("data:image/png;base64,', 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAK', 'CAAAAACoWZBhAAAABGdBTUEAALGPC/xh', @@ -108,13 +108,13 @@ var ηMatrix = (function () { 'KzAzOjAwa+9TNQAAAABJRU5ErkJggg==', '") ', 'repeat scroll #fff' - ].join(''), - placeholderBorder: '1px solid rgba(0, 0, 0, 0.1)', - imagePlaceholder: true, - imagePlaceholderBackground: 'default', - imagePlaceholderBorder: 'default', - framePlaceholder: true, - framePlaceholderDocument: [ + ].join(''), + placeholderBorder: '1px solid rgba(0, 0, 0, 0.1)', + imagePlaceholder: true, + imagePlaceholderBackground: 'default', + imagePlaceholderBorder: 'default', + framePlaceholder: true, + framePlaceholderDocument: [ '', '', '