feat: support for a waitForBoot command to call getBooted
This commit is contained in:
parent
4074f2475d
commit
1d7be971df
|
@ -1,4 +1,4 @@
|
||||||
import { getTimer } from "../vars.js";
|
import { getBooted, getTimer } from "../vars.js";
|
||||||
import browser from "webextension-polyfill";
|
import browser from "webextension-polyfill";
|
||||||
import { logLargeObjects } from "./background/util.js";
|
import { logLargeObjects } from "./background/util.js";
|
||||||
import { queryKernel } from "./background/kernel.js";
|
import { queryKernel } from "./background/kernel.js";
|
||||||
|
@ -25,6 +25,11 @@ browser.runtime.onMessage.addListener(async (request, sender) => {
|
||||||
return Promise.reject("data required");
|
return Promise.reject("data required");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.method === "waitForBoot") {
|
||||||
|
await getBooted();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const ret = await queryKernel({
|
const ret = await queryKernel({
|
||||||
method: request.method,
|
method: request.method,
|
||||||
data: request.data,
|
data: request.data,
|
||||||
|
|
Reference in New Issue