vuejs / vuejs/devtools

addCustomTab not working with sfc or vnode type under Firefox

Open
#931 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.9k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Firefox 140.0esr using debian
Vue DevTools 7.7.7

I added first example from https://devtools.vuejs.org/plugins/api#addcustomtab into my app.

It does not work in Firefox or Librewolf. In the extension's debug console I'm getting:

EvalError: call to Function() blocked by CSP

...

Content-Security-Policy: The page’s settings blocked a JavaScript eval (script-src) from being executed because it violates the following directive: “script-src 'self'” (Missing 'unsafe-eval') [chunk-JBFUC7OX.js:530:7012](moz-extension://a836d2fe-7325-4b3b-a32d-ec802212510c/dist/chunk-JBFUC7OX.js)

SFC works fine when running as vite plugin or standalone app.

I also tried:

import Count from './count.vue';

addCustomTab({
  name: 'plugin-count2',
  title: 'Plugin Count2',
  icon: 'baseline-exposure-plus-1',
  view: {
    type: 'vnode',
    vnode: Count,
  },
  category: 'app',
})

No error, empty tab.
VNode type does not work at all in FF, vite or standalone app.

Contributor guide

No contributing guide indexed for this repository

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 with the addCustomTab example in the documented plugins API and reproduce it in Firefox or Librewolf using the reported extension console error in chunk-JBFUC7OX.js. Compare the SFC and vnode cases across the extension, Vite plugin, and standalone app; done means both custom-tab views render without the CSP error or an empty tab.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.