Skip to content

Commit f97c3c4

Browse files
committed
Fallback to different way when openOptionsPage fail to open options page.
1 parent a5a6783 commit f97c3c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/chrome/assets/js/popup.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ $(document).ready(function() {
7676
ga('send', 'event', 'options', 'click');
7777

7878
if (chrome.runtime.openOptionsPage) {
79-
chrome.runtime.openOptionsPage();
79+
chrome.runtime.openOptionsPage(function() {
80+
if (chrome.runtime.lastError) {
81+
// fallback
82+
window.open(chrome.runtime.getURL('options.html'));
83+
}
84+
});
8085
}
8186
else {
8287
window.open(chrome.runtime.getURL('options.html'));

0 commit comments

Comments
 (0)