fix alert after saving settings on firefox and chrome

This commit is contained in:
Dima Gerasimov 2022-12-28 00:36:50 +00:00 committed by karlicoss
parent d5a0c35848
commit ea8d270a9f
2 changed files with 8 additions and 3 deletions

View file

@ -72,8 +72,12 @@ async function saveOptions() {
} }
await setOptions(opts) await setOptions(opts)
// hmm seems that regular alert() doesn't work in chrome anymore // NOTE: seems that alert() only works here when we use open_in_tab: true for settings page
chrome.extension.getBackgroundPage().alert('Saved!') // 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!')
} }

View file

@ -9,7 +9,8 @@
"persistent": false "persistent": false
}, },
"options_ui": { "options_ui": {
"page": "options.html" "page": "options.html",
"open_in_tab": false
}, },
"icons": { "icons": {
"128": "img/unicorn.png" "128": "img/unicorn.png"