Skip to content

Commit ffcd832

Browse files
committed
fix: use tabs.create instead of window.open for Safari compatibility
Safari sidepanel doesn't support window.open reliably. Use api.tabs.create for opening profiles, vault, and settings pages. Fixes profiles screen not showing in Safari.
1 parent dc680e7 commit ffcd832

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

distros/safari/sidepanel.build.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sidepanel.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,13 @@ function openOptions() {
990990

991991
function openUrl(path) {
992992
const url = api.runtime.getURL(path);
993-
// Use named window target so all options pages open in the same tab
994-
window.open(url, 'nostrkey-options');
993+
// Safari doesn't support window.open() from sidepanel reliably.
994+
// Use tabs.create for cross-browser compatibility.
995+
if (api.tabs && api.tabs.create) {
996+
api.tabs.create({ url });
997+
} else {
998+
window.open(url, 'nostrkey-options');
999+
}
9951000
}
9961001

9971002
async function refreshPasswordState() {

0 commit comments

Comments
 (0)