-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow displaying side panel only on specific pages #1272
Comments
I was not familiar with this use-case... It's a good idea. The boilerplate to set this up, while possible today, is quite annoying:
Here's the full example: website-specific-sidepanel-example.zip |
Thinking about how to implement this... It would be really nice if you could just provide the match patterns in a meta field, then WXT would automatically setup all that code in the background for you: <meta name="sidepanel.matchPatterns" value="['*://*.wxt.dev/*']"></meta> But we need to consider all the use-cases.
Any other use-cases I'm missing? I'm basically just copying from Chrome's docs... Only other case I can think of is combining options 1 and 2. Providing both a default path AND additional sidepanels with match patterns. So let's think about the ideal way to implment these:
If we need to support combining a default panel with other panel's specific to websites, we could use a custom named So with that in mind, here's the changes I would recommend we make: <meta name="wxt.matchPatterns" value="['*://*.wxt.dev/*']"></meta>
<meta name="wxt.openOnActionClick" value="true"></meta>
If there are multiple sidepanel entrypoints, we should only allow one without any match patterns. |
How will we write that
programmatically? I've got the options from all the sidepanels. |
With |
Can we use magicast to write that code in background.ts file? |
Yes. But actually there's a third option: implement #1038 and add a virtual background entrypoint that does this. That would probably be the simplest option. I would prefer we do that. |
Feature Request
Current WXT always adds a
side_panel
entry to the manifest file if at least one side panel is present. That makes the side panel be displayed on every site (i.e. it doesn't matter where and when I open the extension's side panel, it will be preserved across the tab switches). I would like to display the side panel only when a certain website is displayed in a tab, when I switch to a different tab, the side panel should be hidden.This is possible by adding some code to the background/service worker script as described here, but it doesn't work if the
side_panel
entry withdefault_path
is defined in the manifest.I'd like to have an option to remove this entry entirely from the manifest, perhaps through
<meta>
tag although I don't have a big preferenceIs your feature request related to a bug?
N/A
What are the alternatives?
I just found out that it should be possible to remove it through hooks, but I haven't checked it yet. In any case I think it would be nice to have a cleaner option for doing so.
Additional context
N/A
The text was updated successfully, but these errors were encountered: