-
|
What is the intended way of ContextI am building a little website. Coming from that initial website that is basically just storing data I thought we need to store/sync data and thus "converted" it into a WebExtension for data storage via Anyway, the more generic question is: If you have to link to a HTML (or, for whatever matter, to some other asset like an image or whatever), how to best open it in a wxt-compiled extension/code? Use casesExamples for why you would want this:
Concrete example/codeIntuitively, me (and LLMs 🙃) would write this (given the default project structure) for the popup example: browser.tabs.create({url: browser.runtime.getURL('entrypoints/popup/index.html')}); However, apparently correct (after the build steps, as far as I saw in all build variants) would be: browser.tabs.create({url: browser.runtime.getURL('popup.html')});Finding this really left me puzzling and I also see ProblemNow, the "solution" above still is problematic. It is like "guessing" a path, it's not included in the build, thus:
So is there any better way? Preliminary suggestionsIf there is no existing way, ideas for improvement would be:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
There has been discussion around creating constants or enums that can be used instead of a type-literal, can't look that issue up right now. |
Beta Was this translation helpful? Give feedback.
browser.runtime.getURLis type-safe - there's no need to guess what the output path is, WXT tells you what the possibe options are.There has been discussion around creating constants or enums that can be used instead of a type-literal, can't look that issue up right now.