Index: chrome/ext/background.js |
diff --git a/chrome/ext/background.js b/chrome/ext/background.js |
index 49c0366bfcfe9de61f4b472c0131ea9f3ba614e8..2c146dbc10250dd66504c9f165f9ded25241c09f 100644 |
--- a/chrome/ext/background.js |
+++ b/chrome/ext/background.js |
@@ -604,7 +604,32 @@ |
if ("openOptionsPage" in chrome.runtime) |
{ |
- ext.showOptions = chrome.runtime.openOptionsPage; |
+ ext.showOptions = function(callback) |
+ { |
+ if (!callback) |
+ { |
+ chrome.runtime.openOptionsPage(); |
+ } |
+ else |
+ { |
+ chrome.runtime.openOptionsPage(() => |
+ { |
+ if (chrome.runtime.lastError) |
+ return; |
+ |
+ chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => |
+ { |
+ if (tabs.length > 0) |
+ { |
+ window.setTimeout(() => |
kzar
2016/12/09 10:08:21
(Necessary for the notification preferences option
|
+ { |
+ callback(new Page(tabs[0])); |
+ }); |
+ } |
+ }); |
+ }); |
+ } |
+ }; |
} |
else |
{ |