From e5b6f0fe20d7b849bf6f86ae05a04ca491f3737e Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Wed, 2 Oct 2024 13:50:36 +0100 Subject: [PATCH] Remove unnecessary null check for `chrome.scripting` This API is always present as we only support Manifest V3. --- src/background/chrome-api.ts | 2 +- tests/background/chrome-api-test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/background/chrome-api.ts b/src/background/chrome-api.ts index e24cbeec..02b3b2b3 100644 --- a/src/background/chrome-api.ts +++ b/src/background/chrome-api.ts @@ -73,7 +73,7 @@ export function getChromeAPI(chrome = globalThis.chrome) { }, scripting: { - executeScript: chrome.scripting?.executeScript, + executeScript: chrome.scripting.executeScript, }, storage: { diff --git a/tests/background/chrome-api-test.js b/tests/background/chrome-api-test.js index a2efde1a..2dbb1928 100644 --- a/tests/background/chrome-api-test.js +++ b/tests/background/chrome-api-test.js @@ -47,6 +47,10 @@ describe('chrome-api', () => { update: sinon.stub(), }, + scripting: { + executeScript: sinon.stub(), + }, + storage: { sync: { get: sinon.stub(),