Skip to content

Commit

Permalink
fix alert after saving settings on firefox and chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Dec 28, 2022
1 parent d5a0c35 commit ea8d270
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions extension/src/js/options_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ async function saveOptions() {
}
await setOptions(opts)

// hmm seems that regular alert() doesn't work in chrome anymore
chrome.extension.getBackgroundPage().alert('Saved!')
// NOTE: seems that alert() only works here when we use open_in_tab: true for settings page
// when open_in_tab: false, then
// in chrome browser.extension.getBackgroundPage().alert works
// in firefox that doesn't work, seems that it refuses to alert from bg page
// so it seems easier to just always use opne_in_tab: true for setgings page
alert('Saved!')
}


Expand Down
3 changes: 2 additions & 1 deletion extension/src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"persistent": false
},
"options_ui": {
"page": "options.html"
"page": "options.html",
"open_in_tab": false
},
"icons": {
"128": "img/unicorn.png"
Expand Down

0 comments on commit ea8d270

Please sign in to comment.