05/02/2026 fixed extension hook issues
This commit is contained in:
@@ -33,6 +33,28 @@ async function applyIdleInterval() {
|
||||
// Apply on every SW startup (SW can be killed and restarted at any time).
|
||||
applyIdleInterval();
|
||||
|
||||
// Allow content scripts to read chrome.storage.session.
|
||||
// By default, MV3 session storage is restricted to TRUSTED_CONTEXTS only
|
||||
// (background service worker + popup). Without this call, every
|
||||
// chrome.storage.session.get() in content.js silently returns undefined,
|
||||
// so vault_items_cs is never read and the autofill dropdown always shows
|
||||
// "No saved passwords for this site." even when credentials exist.
|
||||
chrome.storage.session.setAccessLevel(
|
||||
{ accessLevel: "TRUSTED_AND_UNTRUSTED_CONTEXTS" },
|
||||
() => {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.warn(
|
||||
"[PassKeeper] setAccessLevel failed:",
|
||||
chrome.runtime.lastError.message,
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
"[PassKeeper] session storage access level set to TRUSTED_AND_UNTRUSTED_CONTEXTS",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
chrome.idle.onStateChanged.addListener(async (newState) => {
|
||||
if (newState === "idle" || newState === "locked") {
|
||||
// Check if the user set "Never" before locking.
|
||||
|
||||
+716
-434
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user