more reliable launcher check

This commit is contained in:
dragonwocky 2021-10-04 22:10:41 +11:00
parent e035f385ca
commit ea0992a9d8

View File

@ -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))) {