diff --git a/Extension/src/background/api/filtering-log.ts b/Extension/src/background/api/filtering-log.ts index 1c3fa49a93..79b9622be0 100644 --- a/Extension/src/background/api/filtering-log.ts +++ b/Extension/src/background/api/filtering-log.ts @@ -140,6 +140,12 @@ export class FilteringLogApi { public onOpenFilteringLogPage(): void { this.openedFilteringLogsPages += 1; + try { + Engine.api.setVerboseScriptletsLogging(true); + } catch (e) { + Log.error('Failed to enable `verbose scriptlets logging` option', e); + } + try { Engine.api.setCollectHitStats(true); } catch (e) { @@ -158,6 +164,12 @@ export class FilteringLogApi { tabInfo.filteringEvents = []; }); + try { + Engine.api.setVerboseScriptletsLogging(false); + } catch (e) { + Log.error('Failed to disable `verbose scriptlets logging` option', e); + } + if (settingsStorage.get(SettingOption.DisableCollectHits)) { try { Engine.api.setCollectHitStats(false); diff --git a/Extension/src/background/api/settings/main.ts b/Extension/src/background/api/settings/main.ts index 8ce98334fb..fc2139376e 100644 --- a/Extension/src/background/api/settings/main.ts +++ b/Extension/src/background/api/settings/main.ts @@ -146,6 +146,7 @@ export class SettingsApi { assistantUrl: `/${ASSISTANT_INJECT_OUTPUT}.js`, documentBlockingPageUrl: `${Prefs.baseUrl}${DOCUMENT_BLOCK_OUTPUT}.html`, collectStats: !settingsStorage.get(SettingOption.DisableCollectHits) || filteringLogApi.isOpen(), + verboseScriptletsLogging: filteringLogApi.isOpen(), allowlistInverted: !settingsStorage.get(SettingOption.DefaultAllowlistMode), allowlistEnabled: settingsStorage.get(SettingOption.AllowlistEnabled), stealthModeEnabled: !settingsStorage.get(SettingOption.DisableStealthMode), diff --git a/tests/helpers/mocks/tswebextension.ts b/tests/helpers/mocks/tswebextension.ts index e3f8ecd033..dffe97b276 100644 --- a/tests/helpers/mocks/tswebextension.ts +++ b/tests/helpers/mocks/tswebextension.ts @@ -48,6 +48,8 @@ export class MockedTsWebExtension { public setCollectHitStats = jest.fn(); + public setVerboseScriptletsLogging = jest.fn(); + public setStealthModeEnabled = jest.fn(); public setSelfDestructFirstPartyCookies = jest.fn();