|
|
|
@ -3,7 +3,7 @@ import { idb, nests } from "./common"
|
|
|
|
|
const nest = nests.make()
|
|
|
|
|
|
|
|
|
|
async function init() {
|
|
|
|
|
const extNest = demon.require("internal/nest")
|
|
|
|
|
const extNest = demon.summon("internal/nest")
|
|
|
|
|
if (!window.__demon) { // this *shouldn't* be required but if we magically run into a race condition it's better to be safe
|
|
|
|
|
window.__demon = {}
|
|
|
|
|
}
|
|
|
|
@ -34,7 +34,7 @@ async function init() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function add(iife, meta) {
|
|
|
|
|
const extNest = demon.require("internal/nest")
|
|
|
|
|
const extNest = demon.summon("internal/nest")
|
|
|
|
|
const currdemon = await idb.get("demon")
|
|
|
|
|
currdemon.plugins[meta.name] = {
|
|
|
|
|
initialize: iife,
|
|
|
|
@ -46,7 +46,7 @@ async function add(iife, meta) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function del(name) {
|
|
|
|
|
const extNest = demon.require("internal/nest")
|
|
|
|
|
const extNest = demon.summon("internal/nest")
|
|
|
|
|
const currdemon = await idb.get("demon")
|
|
|
|
|
if (!!currdemon.plugins[name])
|
|
|
|
|
if (currdemon.status[name].running) {
|
|
|
|
@ -61,7 +61,7 @@ async function del(name) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function toggle(name) {
|
|
|
|
|
const extNest = demon.require("internal/nest")
|
|
|
|
|
const extNest = demon.summon("internal/nest")
|
|
|
|
|
const currdemon = await idb.get("demon")
|
|
|
|
|
if (!!currdemon.plugins[name]) {
|
|
|
|
|
if (currdemon.status[name]?.running) {
|
|
|
|
|