Secret option to ignore install hook. Useful during development.

This commit is contained in:
Ryan Breen
2023-01-22 21:19:47 -05:00
parent 8c7c5f2214
commit bec11edccb
2 changed files with 14 additions and 11 deletions

View File

@@ -2,10 +2,13 @@ import { generatePrivateKey, getPublicKey, signEvent, nip04, nip19 } from "nostr
const storage = browser.storage.local;
browser.runtime.onInstalled.addListener(({reason}) => {
console.log('install handler run');
browser.runtime.onInstalled.addListener(async ({reason}) => {
// I would like to be able to skip this for development purposes
let ignoreHook = (await storage.get('ignoreInstallHook')).ignoreInstallHook
if (ignoreHook === true) {
return;
}
if (['install'].includes(reason)) {
console.log('install handler create tab');
browser.tabs.create({
url: 'https://ursus.camp/nostore'
})