From b9f3523c9539ecf1c603d304742e1d010ff22a7a Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 29 Jul 2023 09:33:24 -0400 Subject: [PATCH] [mv3] Add managed setting to disable first-run page Related discussion: - https://github.com/uBlockOrigin/uBOL-issues/discussions/61 Example of usage (chromium/linux): { "3rdparty": { "extensions": { "ddkjiahejlhfcafbddmgiahcphecmpfh": { "disableFirstRunPage": true } } } } --- platform/mv3/extension/js/background.js | 6 +++++- platform/mv3/extension/managed_storage.json | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/mv3/extension/js/background.js b/platform/mv3/extension/js/background.js index 1fb10cd23..43d6d67da 100644 --- a/platform/mv3/extension/js/background.js +++ b/platform/mv3/extension/js/background.js @@ -31,6 +31,7 @@ import { runtime, localRead, localWrite, sessionRead, sessionWrite, + adminRead, } from './ext.js'; import { @@ -317,7 +318,10 @@ async function start() { ); if ( firstRun ) { - runtime.openOptionsPage(); + const disableFirstRunPage = await adminRead('disableFirstRunPage'); + if ( disableFirstRunPage !== true ) { + runtime.openOptionsPage(); + } } } diff --git a/platform/mv3/extension/managed_storage.json b/platform/mv3/extension/managed_storage.json index 6faefaa8f..8571f59db 100644 --- a/platform/mv3/extension/managed_storage.json +++ b/platform/mv3/extension/managed_storage.json @@ -6,6 +6,10 @@ "title": "List of domains for which no filtering should occur", "type": "array", "items": { "type": "string" } + }, + "disableFirstRunPage": { + "title": "Disable first run page", + "type": "boolean" } } }