Enable Umami analytics generate error in offscreen
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I'm provide umami analytics in my extension
app.config.ts
export default defineAppConfig({ analytics: { enabled: storage.defineItem("local:enabled", { init: () => false }), userId: storage.defineItem("local:key", { init: () => crypto.randomUUID() as string | undefined }), userProperties: storage.defineItem("local:properties-key", { init: () => ({}) }), providers: [ umami({ apiUrl: umamiApiUrl, websiteId: umamiWebsiteId, domain: umamiDomain }) ] } });
And I have offscreen that run with my extension on browser run
background.ts
`
(async () => {
const contexts = await browser.runtime.getContexts({
contextTypes: [browser.runtime.ContextType.OFFSCREEN_DOCUMENT]
});
if (!contexts.length) {
await browser.offscreen.createDocument({
url: "/offscreen.html",
reasons: ["DOM_SCRAPING"],
justification: "Some reason"
});
}
await waitForOffscreenReady();
})();
`
With this I got error in offscreen
Uncaught (in promise) Error: You must add the 'storage' permission to your manifest to use 'wxt/storage'
even when I have storage in my manifest
Reproduction
Enable umami in app with described steps
Steps to reproduce
No response
System Info
Mac os,
Used Package Manager
pnpm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the storage permission handling from app.config.ts into the generated offscreen context, then compare it with the background.ts setup and manifest output. Reproduce the Umami configuration with offscreen.html and verify that the offscreen context no longer reports a missing storage permission when the manifest includes it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100