From ea0992a9d83a18080e0506489f8e60b5027d2511 Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Mon, 4 Oct 2021 22:10:41 +1100 Subject: [PATCH] more reliable launcher check --- extension/launcher.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extension/launcher.js b/extension/launcher.js index 730ba8f..6b7b018 100644 --- a/extension/launcher.js +++ b/extension/launcher.js @@ -7,12 +7,12 @@ 'use strict'; (async () => { - if (location.pathname === '/') await new Promise((res, rej) => setTimeout(res, 500)); - const site = location.host.endsWith('.notion.site'), - page = location.pathname.split(/[/-]/g).reverse()[0].length === 32; + page = location.pathname.split(/[/-]/g).reverse()[0].length === 32, + root = location.pathname === '/', + signedIn = localStorage['LRU:KeyValueStore2:current-user-id']; - if (site || page) { + if (site || page || (root && signedIn)) { import(chrome.runtime.getURL('api/_.mjs')).then(async (api) => { const { fs, registry, web } = api; for (const mod of await registry.list((mod) => registry.enabled(mod.id))) {