wxt-dev / wxt-dev/wxt

Allow displaying side panel only on specific pages

Open
#1,272 9 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

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 with default_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 preference

Is 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the manifest generation entry point and the code that adds the side_panel entry when a side panel is present. Review the existing hooks alternative and the Chrome sidePanel API guidance linked in the issue. Done means a supported configuration can omit side_panel from the manifest, with coverage for the resulting manifest behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.