Skip to content
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

Ability to exclude entrypoints from specific browser targets #113

Closed
aklinker1 opened this issue Sep 15, 2023 · 0 comments · Fixed by #115
Closed

Ability to exclude entrypoints from specific browser targets #113

aklinker1 opened this issue Sep 15, 2023 · 0 comments · Fixed by #115
Labels

Comments

@aklinker1
Copy link
Collaborator

aklinker1 commented Sep 15, 2023

Feature Request

If targeting a different browser, it can be useful to not include specific entrypoints.

JS

export default defineContentScript({
  exclude: ["safari"], // Excludes content script from safari
});
export default defineBackground({
  include: ["firefox"], // Only includes a background script for Firefox
});
// For unlisted files, we probably need to add a default export as well.
export default defineUnlistedScript({
  exclude: ["chrome", "safari"],
  main() {
    // ...
  }
});

HTML

<!doctype html>
<html lang="en">
  <head>
    <!-- Exclude this HTML page from Firefox and Safari -->
    <meta name="manifest.exclude" content="['firefox', 'safari']" />
  </head>
  <body>
    <!-- ... -->
  </body>
</html>

CSS

Then for CSS... I don't know what to do. Ideally, you would use a content script and not have a CSS file directly, but that's not always best all the time.

Is your feature request related to a bug?

N/A

What are the alternatives?

Using transformManifest to remove the entrypoint and delete built files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant