(details = {
cookieStoreId: "firefox-default"
})
| 74 | }; |
| 75 | |
| 76 | const initializeWithTab = async (details = { |
| 77 | cookieStoreId: "firefox-default" |
| 78 | }) => { |
| 79 | let tab; |
| 80 | const webExtension = await buildDom({ |
| 81 | background: { |
| 82 | async afterBuild(background) { |
| 83 | tab = await background.browser.tabs._create(details); |
| 84 | } |
| 85 | }, |
| 86 | popup: { |
| 87 | jsdom: { |
| 88 | beforeParse(window) { |
| 89 | window.browser.storage.local.set({ |
| 90 | "browserActionBadgesClicked": [], |
| 91 | "onboarding-stage": 7, |
| 92 | "achievements": [], |
| 93 | "syncEnabled": true, |
| 94 | "replaceTabEnabled": false, |
| 95 | "mozillaVpnInstalled": false, |
| 96 | }); |
| 97 | window.browser.storage.local.set.resetHistory(); |
| 98 | window.browser.storage.sync.clear(); |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | }); |
| 103 | webExtension.tab = tab; |
| 104 | |
| 105 | return webExtension; |
| 106 | }; |
| 107 | |
| 108 | module.exports = { |
| 109 | buildDom, |
no test coverage detected