Skip to content

Commit

Permalink
[workflow] Update uBOLite MV3 package files for uBOLite_2024.11.11.1298
Browse files Browse the repository at this point in the history
Files changed:
M	chromium/_locales/cy/messages.json
M	chromium/_locales/ko/messages.json
M	chromium/css/settings.css
A	chromium/js/admin.js
M	chromium/js/background.js
A	chromium/js/config.js
M	chromium/js/mode-manager.js
M	chromium/js/ruleset-manager.js
M	chromium/js/settings.js
M	chromium/js/utils.js
M	chromium/log.txt
M	chromium/managed_storage.json
M	chromium/manifest.json
M	chromium/rulesets/generic-details.json
M	chromium/rulesets/main/annoyances-cookies.json
M	chromium/rulesets/main/annoyances-others.json
M	chromium/rulesets/main/annoyances-overlays.json
M	chromium/rulesets/main/bgr-0.json
M	chromium/rulesets/main/chn-0.json
M	chromium/rulesets/main/default.json
M	chromium/rulesets/main/deu-0.json
M	chromium/rulesets/main/dpollock-0.json
M	chromium/rulesets/main/fra-0.json
M	chromium/rulesets/main/grc-0.json
M	chromium/rulesets/main/ind-0.json
M	chromium/rulesets/main/irn-0.json
M	chromium/rulesets/main/ita-0.json
M	chromium/rulesets/main/jpn-1.json
M	chromium/rulesets/main/kor-1.json
M	chromium/rulesets/main/nld-0.json
M	chromium/rulesets/main/pol-0.json
M	chromium/rulesets/main/rou-1.json
M	chromium/rulesets/main/rus-0.json
M	chromium/rulesets/main/spa-0.json
M	chromium/rulesets/main/spa-1.json
M	chromium/rulesets/main/stevenblack-hosts.json
M	chromium/rulesets/main/swe-1.json
M	chromium/rulesets/main/tur-0.json
M	chromium/rulesets/main/vie-1.json
M	chromium/rulesets/modify-headers/default.json
M	chromium/rulesets/modify-headers/vie-1.json
M	chromium/rulesets/redirect/default.json
M	chromium/rulesets/redirect/rou-1.json
M	chromium/rulesets/redirect/spa-1.json
M	chromium/rulesets/regex/chn-0.json
M	chromium/rulesets/regex/default.json
M	chromium/rulesets/regex/fra-0.json
M	chromium/rulesets/regex/kor-1.json
M	chromium/rulesets/removeparam/adguard-spyware-url.json
M	chromium/rulesets/ruleset-details.json
M	chromium/rulesets/scripting/declarative/annoyances-cookies.js
M	chromium/rulesets/scripting/declarative/annoyances-overlays.js
M	chromium/rulesets/scripting/declarative/default.js
M	chromium/rulesets/scripting/declarative/jpn-1.js
M	chromium/rulesets/scripting/declarative/rus-0.js
M	chromium/rulesets/scripting/declarative/swe-1.js
M	chromium/rulesets/scripting/generic/annoyances-cookies.js
M	chromium/rulesets/scripting/generic/annoyances-others.js
M	chromium/rulesets/scripting/generic/annoyances-social.js
M	chromium/rulesets/scripting/generic/chn-0.js
M	chromium/rulesets/scripting/generic/default.js
M	chromium/rulesets/scripting/generic/ita-0.js
M	chromium/rulesets/scripting/generic/spa-0.js
M	chromium/rulesets/scripting/generichigh/default.css
M	chromium/rulesets/scripting/generichigh/ita-0.css
M	chromium/rulesets/scripting/generichigh/vie-1.css
M	chromium/rulesets/scripting/procedural/annoyances-overlays.js
M	chromium/rulesets/scripting/procedural/annoyances-social.js
M	chromium/rulesets/scripting/procedural/chn-0.js
M	chromium/rulesets/scripting/procedural/default.js
M	chromium/rulesets/scripting/procedural/fin-0.js
M	chromium/rulesets/scripting/procedural/irn-0.js
M	chromium/rulesets/scripting/procedural/jpn-1.js
M	chromium/rulesets/scripting/procedural/nor-0.js
M	chromium/rulesets/scripting/procedural/rus-0.js
M	chromium/rulesets/scripting/procedural/spa-0.js
M	chromium/rulesets/scripting/procedural/spa-1.js
M	chromium/rulesets/scripting/procedural/swe-1.js
M	chromium/rulesets/scripting/procedural/tur-0.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.remove-class.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.trusted-click-element.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.trusted-set-cookie.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.trusted-set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-cookies.trusted-set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-others.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/annoyances-others.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/annoyances-others.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-others.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.abort-current-script.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.abort-on-property-read.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.abort-on-property-write.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.addEventListener-defuser.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.no-setInterval-if.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.no-setTimeout-if.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.remove-attr.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.remove-node-text.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.set-constant.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.trusted-click-element.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.trusted-set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.trusted-set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/annoyances-overlays.trusted-suppress-native-method.js
M	chromium/rulesets/scripting/scriptlet/annoyances-social.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/chn-0.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/chn-0.set-constant.js
M	chromium/rulesets/scripting/scriptlet/chn-0.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/cze-0.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/cze-0.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/default.abort-current-script.js
M	chromium/rulesets/scripting/scriptlet/default.abort-on-property-read.js
M	chromium/rulesets/scripting/scriptlet/default.abort-on-property-write.js
M	chromium/rulesets/scripting/scriptlet/default.abort-on-stack-trace.js
M	chromium/rulesets/scripting/scriptlet/default.addEventListener-defuser.js
M	chromium/rulesets/scripting/scriptlet/default.adjust-setInterval.js
M	chromium/rulesets/scripting/scriptlet/default.json-prune-fetch-response.js
M	chromium/rulesets/scripting/scriptlet/default.no-setInterval-if.js
M	chromium/rulesets/scripting/scriptlet/default.no-setTimeout-if.js
M	chromium/rulesets/scripting/scriptlet/default.noeval-if.js
M	chromium/rulesets/scripting/scriptlet/default.prevent-fetch.js
M	chromium/rulesets/scripting/scriptlet/default.prevent-window-open.js
M	chromium/rulesets/scripting/scriptlet/default.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/default.remove-attr.js
M	chromium/rulesets/scripting/scriptlet/default.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/default.remove-node-text.js
M	chromium/rulesets/scripting/scriptlet/default.set-constant.js
M	chromium/rulesets/scripting/scriptlet/default.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/default.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/default.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/default.spoof-css.js
M	chromium/rulesets/scripting/scriptlet/default.trusted-prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/default.trusted-replace-node-text.js
A	chromium/rulesets/scripting/scriptlet/default.trusted-replace-outbound-text.js
M	chromium/rulesets/scripting/scriptlet/default.trusted-set-constant.js
M	chromium/rulesets/scripting/scriptlet/fin-0.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/fra-0.abort-on-stack-trace.js
M	chromium/rulesets/scripting/scriptlet/fra-0.addEventListener-defuser.js
M	chromium/rulesets/scripting/scriptlet/fra-0.no-setInterval-if.js
M	chromium/rulesets/scripting/scriptlet/fra-0.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/fra-0.remove-node-text.js
M	chromium/rulesets/scripting/scriptlet/fra-0.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/hun-0.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/hun-0.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/irn-0.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/irn-0.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/irn-0.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/irn-0.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.abort-current-script.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.addEventListener-defuser.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.noeval-if.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.remove-attr.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.remove-node-text.js
M	chromium/rulesets/scripting/scriptlet/jpn-1.set-cookie-reload.js
M	chromium/rulesets/scripting/scriptlet/kor-1.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/kor-1.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/rus-0.abort-on-property-read.js
M	chromium/rulesets/scripting/scriptlet/rus-0.adjust-setInterval.js
M	chromium/rulesets/scripting/scriptlet/rus-0.no-setTimeout-if.js
M	chromium/rulesets/scripting/scriptlet/rus-0.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/rus-0.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/rus-0.set-attr.js
M	chromium/rulesets/scripting/scriptlet/rus-0.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/rus-0.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/spa-1.adjust-setTimeout.js
M	chromium/rulesets/scripting/scriptlet/spa-1.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/spa-1.remove-attr.js
M	chromium/rulesets/scripting/scriptlet/spa-1.set-constant.js
M	chromium/rulesets/scripting/scriptlet/spa-1.set-cookie-reload.js
M	chromium/rulesets/scripting/scriptlet/spa-1.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/spa-1.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/swe-1.noeval-if.js
M	chromium/rulesets/scripting/scriptlet/swe-1.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/swe-1.remove-cookie.js
M	chromium/rulesets/scripting/scriptlet/swe-1.remove-node-text.js
M	chromium/rulesets/scripting/scriptlet/swe-1.set-constant.js
M	chromium/rulesets/scripting/scriptlet/swe-1.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/swe-1.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/tur-0.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/tur-0.set-constant.js
M	chromium/rulesets/scripting/scriptlet/tur-0.set-cookie.js
M	chromium/rulesets/scripting/scriptlet/tur-0.set-local-storage-item.js
M	chromium/rulesets/scripting/scriptlet/tur-0.set-session-storage-item.js
M	chromium/rulesets/scripting/scriptlet/vie-1.abort-current-script.js
M	chromium/rulesets/scripting/scriptlet/vie-1.abort-on-property-read.js
M	chromium/rulesets/scripting/scriptlet/vie-1.prevent-xhr.js
M	chromium/rulesets/scripting/scriptlet/vie-1.set-cookie.js
M	chromium/rulesets/scripting/specific/annoyances-cookies.js
M	chromium/rulesets/scripting/specific/annoyances-others.js
M	chromium/rulesets/scripting/specific/annoyances-overlays.js
M	chromium/rulesets/scripting/specific/annoyances-social.js
M	chromium/rulesets/scripting/specific/bgr-0.js
M	chromium/rulesets/scripting/specific/chn-0.js
M	chromium/rulesets/scripting/specific/default.js
M	chromium/rulesets/scripting/specific/deu-0.js
M	chromium/rulesets/scripting/specific/fra-0.js
M	chromium/rulesets/scripting/specific/grc-0.js
M	chromium/rulesets/scripting/specific/idn-0.js
M	chromium/rulesets/scripting/specific/ind-0.js
M	chromium/rulesets/scripting/specific/irn-0.js
M	chromium/rulesets/scripting/specific/isr-0.js
M	chromium/rulesets/scripting/specific/ita-0.js
M	chromium/rulesets/scripting/specific/jpn-1.js
M	chromium/rulesets/scripting/specific/kor-1.js
M	chromium/rulesets/scripting/specific/nld-0.js
M	chromium/rulesets/scripting/specific/nor-0.js
M	chromium/rulesets/scripting/specific/rou-1.js
M	chromium/rulesets/scripting/specific/rus-0.js
M	chromium/rulesets/scripting/specific/spa-0.js
M	chromium/rulesets/scripting/specific/spa-1.js
M	chromium/rulesets/scripting/specific/swe-1.js
M	chromium/rulesets/scripting/specific/tur-0.js
M	chromium/rulesets/scripting/specific/vie-1.js
M	chromium/rulesets/scriptlet-details.json
  • Loading branch information
gorhill committed Nov 11, 2024
1 parent 8c1b5f5 commit 3bc069f
Show file tree
Hide file tree
Showing 220 changed files with 3,588 additions and 2,045 deletions.
6 changes: 3 additions & 3 deletions chromium/_locales/cy/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"description": "Label in the popup panel for the current filtering mode"
},
"popupTipReport": {
"message": "Report an issue on this website",
"message": "Rhoi gwybod am broblem ar y wefan hon",
"description": "Tooltip used for the 'chat' icon in the panel"
},
"popupTipDashboard": {
Expand All @@ -48,7 +48,7 @@
"description": "Label to be used to hide popup panel sections"
},
"3pGroupDefault": {
"message": "Default",
"message": "Diofyn",
"description": "Header for a ruleset section in 'Filter lists pane'"
},
"3pGroupAds": {
Expand Down Expand Up @@ -104,7 +104,7 @@
"description": "Shown in the About pane"
},
"supportS6H": {
"message": "Report a filter issue",
"message": "Adrodd nam ar hidlydd",
"description": "Header of 'Report a filter issue' section in Support pane"
},
"supportS3P1": {
Expand Down
36 changes: 18 additions & 18 deletions chromium/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"description": "Label in the popup panel for the current filtering mode"
},
"popupTipReport": {
"message": "Report an issue on this website",
"message": "이 사이트의 이슈를 신고하기",
"description": "Tooltip used for the 'chat' icon in the panel"
},
"popupTipDashboard": {
Expand Down Expand Up @@ -104,67 +104,67 @@
"description": "Shown in the About pane"
},
"supportS6H": {
"message": "Report a filter issue",
"message": "필터 이슈 신고",
"description": "Header of 'Report a filter issue' section in Support pane"
},
"supportS3P1": {
"message": "Report filter issues with specific websites to the <span data-url=\"https://github.com/uBlockOrigin/uAssets/issues?q=is%3Aissue\"><code>uBlockOrigin/uAssets</code> issue tracker</span>. <u>Requires a GitHub account.</u>",
"message": "특정 웹사이트에서 발생하는 필터 이슈를 <span data-url=\"https://github.com/uBlockOrigin/uAssets/issues?q=is%3Aissue\"><code>uBlockOrigin/uAssets</code> 이슈 트래커</span>에 신고할 수 있습니다. <u>GitHub 계정이 필요합니다.</u>",
"description": "First paragraph of 'Filter issues' section in Support pane"
},
"supportS6P1S1": {
"message": "To avoid burdening volunteers with duplicate reports, please verify that the issue has not already been reported.",
"message": "봉사자들이 중복 신고로 인해 부담을 겪지 않도록, 해당 이슈가 이미 신고되지는 않았는지 확인해주시기 바랍니다.",
"description": "A paragraph in the filter issue reporter section"
},
"supportFindSpecificButton": {
"message": "Find similar reports",
"message": "유사한 신고 탐색",
"description": "A clickable link in the filter issue reporter section"
},
"supportS6URL": {
"message": "Address of the webpage:",
"message": "웹페이지 주소:",
"description": "Label for the URL of the page"
},
"supportS6Select1": {
"message": "The webpage",
"message": "웹페이지가",
"description": "Label for widget to select type of issue"
},
"supportS6Select1Option0": {
"message": "-- Pick an entry --",
"message": "-- 주제 선택 --",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option1": {
"message": "Shows ads or ad leftovers",
"message": "광고나 광고 흔적을 보여줍니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option2": {
"message": "Has overlays or other nuisances",
"message": "오버레이나 기타 성가신 요소를 보여줍니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option3": {
"message": "Detects uBO Lite",
"message": "uBO Lite 사용을 감지합니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option4": {
"message": "Has privacy-related issues",
"message": "개인정보 보호 관련 이슈가 있습니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option5": {
"message": "Malfunctions when uBO Lite is enabled",
"message": "uBO Lite를 켜면 깨집니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option6": {
"message": "Opens unwanted tabs or windows",
"message": "원치 않는 탭이나 창을 엽니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Select1Option7": {
"message": "Leads to badware, phishing",
"message": "악성코드, 피싱으로 유도합니다",
"description": "An entry in the widget used to select the type of issue"
},
"supportS6Checkbox1": {
"message": "Label the webpage as “NSFW (<a href=\"https://wikipedia.org/wiki/Not_safe_for_work\">“Not Safe For Work”</a>)",
"message": "웹페이지를 \"NSFW\" (<a href=\"https://wikipedia.org/wiki/Not_safe_for_work\">“Not Safe For Work”</a>)로 분류",
"description": "A checkbox to use for NSFW sites"
},
"supportReportSpecificButton": {
"message": "Create new report",
"message": "새 신고 생성",
"description": "Text for button which open an external webpage in Support pane"
},
"firstRunSectionLabel": {
Expand Down Expand Up @@ -216,7 +216,7 @@
"description": "A short description for the editable field which lists trusted sites"
},
"noFilteringModePlaceholder": {
"message": "[hostnames only]\nexample.com\ngames.example\n...",
"message": "[호스트 이름만 작성]\nexample.com\ngames.example\n...",
"description": "Default text for in edit field"
},
"behaviorSectionLabel": {
Expand Down
8 changes: 8 additions & 0 deletions chromium/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,19 @@ h3[data-i18n="filteringMode0Name"]::first-letter {
.groupEntry:not([data-groupkey="user"]) .listEntry:not(.isDefault).unused {
display: none;
}

.listEntry.fromAdmin:has(input[disabled]:not(:checked)) {
display: none;
}
.listEntry > * {
margin-left: 0;
margin-right: 0;
unicode-bidi: embed;
}
.listEntry .checkbox:has(input[disabled]),
.listEntry .checkbox:has(input[disabled]) ~ span {
filter: var(--checkbox-disabled-filter);
}
.listEntry .listname {
white-space: nowrap;
}
Expand Down
121 changes: 121 additions & 0 deletions chromium/js/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*******************************************************************************
uBlock Origin Lite - a comprehensive, MV3-compliant content blocker
Copyright (C) 2022-present 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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://github.com/gorhill/uBlock
*/

import {
adminRead,
localRead, localWrite,
sessionRead, sessionWrite,
} from './ext.js';

import {
enableRulesets,
getRulesetDetails,
} from './ruleset-manager.js';

import {
getTrustedSites,
readFilteringModeDetails,
} from './mode-manager.js';

import { broadcastMessage } from './utils.js';
import { dnr } from './ext.js';
import { registerInjectables } from './scripting-manager.js';
import { rulesetConfig } from './config.js';
import { ubolLog } from './debug.js';

/******************************************************************************/

const adminSettings = {
keys: new Set(),
timer: undefined,
change(key) {
this.keys.add(key);
if ( this.timer !== undefined ) { return; }
this.timer = self.setTimeout(( ) => {
this.timer = undefined;
this.process();
}, 127);
},
async process() {
if ( this.keys.has('rulesets') ) {
ubolLog('admin setting "rulesets" changed');
await enableRulesets(rulesetConfig.enabledRulesets);
await registerInjectables();
const results = await Promise.all([
getAdminRulesets(),
dnr.getEnabledRulesets(),
]);
const [ adminRulesets, enabledRulesets ] = results;
broadcastMessage({ adminRulesets, enabledRulesets });
}
if ( this.keys.has('noFiltering') ) {
ubolLog('admin setting "noFiltering" changed');
await readFilteringModeDetails(true);
const trustedSites = await getTrustedSites();
broadcastMessage({ trustedSites: Array.from(trustedSites) });
}
this.keys.clear();
}
};

/******************************************************************************/

export async function getAdminRulesets() {
const adminList = await adminReadEx('rulesets');
const adminRulesets = new Set(Array.isArray(adminList) && adminList || []);
if ( adminRulesets.has('-*') ) {
adminRulesets.delete('-*');
const rulesetDetails = await getRulesetDetails();
for ( const ruleset of rulesetDetails.values() ) {
if ( ruleset.enabled ) { continue; }
if ( adminRulesets.has(`+${ruleset.id}`) ) { continue; }
adminRulesets.add(`-${ruleset.id}`);
}
}
return Array.from(adminRulesets);
}

/******************************************************************************/

export async function adminReadEx(key) {
let cacheValue;
const session = await sessionRead(`admin_${key}`);
if ( session ) {
cacheValue = session.data;
} else {
const local = await localRead(`admin_${key}`);
if ( local ) {
cacheValue = local.data;
}
}
adminRead(key).then(async value => {
const adminKey = `admin_${key}`;
await Promise.all([
sessionWrite(adminKey, { data: value }),
localWrite(adminKey, { data: value }),
]);
if ( JSON.stringify(value) === JSON.stringify(cacheValue) ) { return; }
adminSettings.change(key);
});
return cacheValue;
}

/******************************************************************************/
Loading

0 comments on commit 3bc069f

Please sign in to comment.