fix the onboarding show up on browser restart
This commit is contained in:
@@ -11,25 +11,27 @@ function initService() {
|
||||
await browser.tabs.create({
|
||||
url: browser.runtime.getURL("/onboarding/index.html"),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// listen for post-setup screen
|
||||
browser.cookies.onChanged.addListener(async function (info) {
|
||||
const { removed, cookie } = info;
|
||||
if (!removed && cookie.name === "setup_done") {
|
||||
const currentTab = await browser.tabs.query({
|
||||
active: true,
|
||||
currentWindow: true,
|
||||
});
|
||||
// listen for post-setup screen
|
||||
browser.cookies.onChanged.addListener(async function (info) {
|
||||
const { removed, cookie } = info;
|
||||
if (!removed && cookie.name === "setup_done") {
|
||||
const currentTab = await browser.tabs.query({
|
||||
active: true,
|
||||
currentWindow: true,
|
||||
});
|
||||
|
||||
await delay(100);
|
||||
await delay(100);
|
||||
|
||||
await browser.tabs.update(currentTab[0].id, {
|
||||
url: browser.runtime.getURL("/onboarding/index.html#step3"),
|
||||
await browser.tabs.update(currentTab[0].id, {
|
||||
url: browser.runtime.getURL("/onboarding/index.html#step3"),
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default { initService };
|
||||
|
||||
Reference in New Issue
Block a user