Skip to content

Commit

Permalink
--wip--
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Sep 25, 2023
1 parent 050c471 commit 59a829f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion background/ports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions typings/base/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ declare namespace chrome.scripting {
export function registerContentScripts(scripts: RegisteredContentScript[]): Promise<void>
}

declare namespace chrome.storage {
var session: LocalStorageArea & {
setAccessLevel (level: "TRUSTED_AND_UNTRUSTED_CONTEXTS" | "TRUSTED_CONTEXTS"): Promise<void>
}
}

declare namespace chrome.bookmarks {
export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): 1;
}
Expand Down

0 comments on commit 59a829f

Please sign in to comment.