diff --git a/src/contentScript/sidebarDomControllerLite.ts b/src/contentScript/sidebarDomControllerLite.ts index e9136d7f5d..29301cb988 100644 --- a/src/contentScript/sidebarDomControllerLite.ts +++ b/src/contentScript/sidebarDomControllerLite.ts @@ -29,8 +29,9 @@ import { uuidv4 } from "@/types/helpers"; export const SIDEBAR_WIDTH_CSS_PROPERTY = "--pb-sidebar-width"; const ORIGINAL_MARGIN_CSS_PROPERTY = "--pb-original-margin-right"; +// Use ? because it's somehow not defined in e2e tests. But otherwise it will always be defined. // eslint-disable-next-line local-rules/persistBackgroundData -- Static -const html: HTMLElement = globalThis.document.documentElement; +const html: HTMLElement = globalThis.document?.documentElement; const SIDEBAR_WIDTH_PX = 400; function storeOriginalCSSOnce() {