Skip to content

Commit

Permalink
Fix devtools panel path for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Dec 17, 2024
1 parent 99329a2 commit d88ced2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-apples-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-devtools/extension": patch
---

Fix devtools panel path for firefox
8 changes: 5 additions & 3 deletions packages/extension/devtools/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ const port = chrome.runtime.connect({name: ConnectionName.Devtools})

const {onPortMessage: fromBackground} = createPortMessanger(port)

// Firefox requires absolute path
const PATH_PREFIX = import.meta.env.BROWSER === 'firefox' ? '/' : ''

// "Versions" mean that devtools client is on the page
once(fromBackground, 'Versions', () => {

log('Debugger connected -> Creating Devtools_Panel...')

chrome.devtools.panels.create(
'Solid',
// Firefox requires absolute path
(import.meta.env.BROWSER === 'firefox' ? '/' : '') + icons.disabled[32],
'index.html',
PATH_PREFIX + icons.disabled[32],
PATH_PREFIX + 'index.html',
() => {
if (chrome.runtime.lastError) {
error('Creating Devtools_Panel Failed', chrome.runtime.lastError)
Expand Down

0 comments on commit d88ced2

Please sign in to comment.