diff --git a/background/ports.ts b/background/ports.ts index 38f4eb59a..4edab944e 100644 --- a/background/ports.ts +++ b/background/ports.ts @@ -645,6 +645,9 @@ const tryToKeepAlive = (rawNotFromInterval: BOOL): KKeep | void => { console.log("reuse kept tab id: %o @ %o", newAliveTabId, Date.now() % 9e5) } if (lastKeptTabId_ === -1) { + if (isFromInterval && browser_.storage.session) { + browser_.storage.session.set("recency", {}) + } } else if (typeOfFramesToKeep < KKeep.MIN_HANDLED && typeOfFramesToKeep) { refreshPorts_(framesToKeep!, 0) typeOfFramesToKeep = KKeep.NormalRefreshed @@ -771,7 +774,7 @@ if (Build.MV3 && !OnFirefox && kAliveIfOnlyAnyAction) { , port.s.tabId_, port.s.frameId_, port.s.flags_, Date.now() % 9e5) } } - posted = /*#__NOINLINE__*/ safePost(port, { N: kBgReq.showHUD, H: null, k: 0, t: "" }) + posted = safePost(port, { N: kBgReq.showHUD, H: null, k: 0, t: "" }) } if (!posted) { if (!Build.NDEBUG && DEBUG) { diff --git a/typings/base/base.d.ts b/typings/base/base.d.ts index 2edc38739..12cf567d3 100644 --- a/typings/base/base.d.ts +++ b/typings/base/base.d.ts @@ -196,6 +196,12 @@ declare namespace chrome.scripting { export function registerContentScripts(scripts: RegisteredContentScript[]): Promise } +declare namespace chrome.storage { + var session: LocalStorageArea & { + setAccessLevel (level: "TRUSTED_AND_UNTRUSTED_CONTEXTS" | "TRUSTED_CONTEXTS"): Promise + } +} + declare namespace chrome.bookmarks { export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): 1; }