From d88ced23bd50a86b8dabd8c464377b8c88397604 Mon Sep 17 00:00:00 2001 From: Damian Tarnawski Date: Tue, 17 Dec 2024 10:54:55 +0100 Subject: [PATCH] Fix devtools panel path for firefox --- .changeset/smart-apples-joke.md | 5 +++++ packages/extension/devtools/devtools.ts | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/smart-apples-joke.md diff --git a/.changeset/smart-apples-joke.md b/.changeset/smart-apples-joke.md new file mode 100644 index 00000000..7d318d9f --- /dev/null +++ b/.changeset/smart-apples-joke.md @@ -0,0 +1,5 @@ +--- +"@solid-devtools/extension": patch +--- + +Fix devtools panel path for firefox diff --git a/packages/extension/devtools/devtools.ts b/packages/extension/devtools/devtools.ts index 89db36ce..e40bb624 100644 --- a/packages/extension/devtools/devtools.ts +++ b/packages/extension/devtools/devtools.ts @@ -18,6 +18,9 @@ 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', () => { @@ -25,9 +28,8 @@ once(fromBackground, 'Versions', () => { 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)