04/19 Update extension: persistent session, duplication check - again
This commit is contained in:
@@ -11,8 +11,10 @@
|
||||
* we refresh the access_token and show the unlock-only view (master password only).
|
||||
*/
|
||||
|
||||
const API_BASE = 'https://pwkeeper.ngodanguyen.tech';
|
||||
const API_BASE = 'https://pwkeeper.ngodanguyen.tech';
|
||||
const VAULT_URL = 'https://pwkeeper.ngodanguyen.tech/vault';
|
||||
const GEN_URL = 'https://pwkeeper.ngodanguyen.tech/vault#generator';
|
||||
const ALERTS_URL = 'https://pwkeeper.ngodanguyen.tech/vault#security';
|
||||
|
||||
// ── State ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -531,6 +533,15 @@ async function init() {
|
||||
// Vault actions
|
||||
$('btn-add-item').addEventListener('click', () => { chrome.tabs.create({ url: VAULT_URL }); });
|
||||
$('nav-account').addEventListener('click', signOut);
|
||||
$('nav-generator').addEventListener('click', () => { chrome.tabs.create({ url: GEN_URL }); });
|
||||
$('nav-alerts').addEventListener('click', () => { chrome.tabs.create({ url: ALERTS_URL }); });
|
||||
|
||||
// Keep the service worker alive so chrome.storage.session survives while the
|
||||
// browser is open. We ping it every 20 s; the ping itself is a no-op but
|
||||
// prevents the SW from being killed between popup openings.
|
||||
const _keepalive = setInterval(() => {
|
||||
chrome.runtime.sendMessage({ type: 'KEEPALIVE' }).catch(() => {});
|
||||
}, 20_000);
|
||||
|
||||
// Search
|
||||
$('vault-search').addEventListener('input', () => renderList());
|
||||
|
||||
Reference in New Issue
Block a user