You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for this great Nuxt-inspired tool :).
Looks like the lib currently does not abstract away action in v3 and browserAction in v2. So one would need to define both in wxt.config.js and then distinguish between the cases in the scripts. Would be great to just have browser.action from wxt/browser and action in the config. Or am I missing something?
I haven't used page actions yet but if I understood it correctly they were merged together with browser actions into one action in v3. So I guess the issue is to distinguish between page and browser actions in v2?
Correct, I for one perfer page actions over browser actions, and think MV3 made a bad decision choosing browser actions over page actions for the new action field. it prevents a cluttered navigation bar with all your extensions trying to take up space when they're not even being used... All that to say I like page actions and would recommend people use them. But I also understand that browser actions are the most equivalent to the new action, so it makes sense to default to the browser action...
But anyways, my understanding of your suggestion is that when I have a config file that looks like this:
it should automatically output a browser_action instead while targetting MV2, is that correct? So I'm curious what you'd recommend for opting into converting it to a popup_action instead. I have an idea, but if you have one I'd like to hear that first!
@aklinker1 Yes that's what I mean. I don't have a clear idea or suggestion and I think you are way deeper into the topic. I guess you mean page_action instead of popup_action in your second to last sentence. Maybe it could be made configurable per project which action should resolve to and have decide for one as default.
I also partly solved the issue by forcing mv3 for Firefox since it seems to work fine except for dev mode and I'm fine doublechecking Firefox by manually loading it into the browser. But still ofc, if Firefox mv2 could be made compatible for actions this would be an improvement :).
What about letting you provide a manifest like this:
manifest: {action: {},browser_action: {},}
And WXT automatically strips out any fields that aren't available for the target manifest version. Then if someone wants to use the page action instead, they can just use:
manifest: {action: {},page_action: {},}
And if you exclude both page_action and browser_action, MV2 defaults to a browser_action for compatibility
manifest: {action: {},}
This applies to more than just the action fields. That way you don't have to use a function to remove fields based on the target manifest version, like this:
Activity
aklinker1 commentedon Feb 28, 2024
Are you talking about the case where you're using an action without a popup entrypoint?
If not, see https://wxt.dev/entrypoints/popup.html.
If so, how do you propose letting the extension opt-in to using a page_action instead of a
browser_action?aklinker1 commentedon Feb 28, 2024
Are you talking about the case where you're using an action without a popup entrypoint?
If not, see https://wxt.dev/entrypoints/popup.html.
If so, how do you propose letting the extension opt-in to using a page_action instead of a
browser_action?aklinker1 commentedon Feb 28, 2024
Are you talking about the case where you're using an action without a popup entrypoint?
If not, see https://wxt.dev/entrypoints/popup.html.
If so, how do you propose letting the extension opt-in to using a page_action instead of a
browser_action?aklinker1 commentedon Feb 28, 2024
Are you talking about the case where you're using an action without a popup entrypoint?
If not, see https://wxt.dev/entrypoints/popup.html.
If so, how do you propose letting the extension opt-in to using a
page_actioninstead of abrowser_action?dword-design commentedon Feb 28, 2024
@aklinker1 Yes I mean action without a popup.
I haven't used page actions yet but if I understood it correctly they were merged together with browser actions into one action in v3. So I guess the issue is to distinguish between page and browser actions in v2?
aklinker1 commentedon Feb 28, 2024
Correct, I for one perfer page actions over browser actions, and think MV3 made a bad decision choosing browser actions over page actions for the new action field. it prevents a cluttered navigation bar with all your extensions trying to take up space when they're not even being used... All that to say I like page actions and would recommend people use them. But I also understand that browser actions are the most equivalent to the new action, so it makes sense to default to the browser action...
But anyways, my understanding of your suggestion is that when I have a config file that looks like this:
it should automatically output a
browser_actioninstead while targetting MV2, is that correct? So I'm curious what you'd recommend for opting into converting it to apopup_actioninstead. I have an idea, but if you have one I'd like to hear that first!dword-design commentedon Feb 28, 2024
@aklinker1 Yes that's what I mean. I don't have a clear idea or suggestion and I think you are way deeper into the topic. I guess you mean
page_actioninstead ofpopup_actionin your second to last sentence. Maybe it could be made configurable per project whichactionshould resolve to and have decide for one as default.I also partly solved the issue by forcing mv3 for Firefox since it seems to work fine except for dev mode and I'm fine doublechecking Firefox by manually loading it into the browser. But still ofc, if Firefox mv2 could be made compatible for actions this would be an improvement :).
aklinker1 commentedon Feb 28, 2024
Oh yeah, sorry,
page_actionis what I meant.What about letting you provide a manifest like this:
And WXT automatically strips out any fields that aren't available for the target manifest version. Then if someone wants to use the page action instead, they can just use:
And if you exclude both
page_actionandbrowser_action, MV2 defaults to abrowser_actionfor compatibilityThis applies to more than just the
actionfields. That way you don't have to use a function to remove fields based on the target manifest version, like this:Which is annoying to write.
dword-design commentedon Feb 29, 2024
@aklinker1 Sounds good to me 🤔
aklinker1 commentedon Mar 3, 2024
Released in
v0.17.6