mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-19 11:09:03 +00:00
more reliable launcher check
This commit is contained in:
parent
e035f385ca
commit
ea0992a9d8
@ -7,12 +7,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
if (location.pathname === '/') await new Promise((res, rej) => setTimeout(res, 500));
|
|
||||||
|
|
||||||
const site = location.host.endsWith('.notion.site'),
|
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) => {
|
import(chrome.runtime.getURL('api/_.mjs')).then(async (api) => {
|
||||||
const { fs, registry, web } = api;
|
const { fs, registry, web } = api;
|
||||||
for (const mod of await registry.list((mod) => registry.enabled(mod.id))) {
|
for (const mod of await registry.list((mod) => registry.enabled(mod.id))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user