Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/background.js

Issue 6622721232338944: Issue 1268 - Correctly mimic Chrome's behavior when opening the options page (Closed)
Patch Set: Created Aug. 26, 2014, 2:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « popup.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/background.js
===================================================================
--- a/safari/ext/background.js
+++ b/safari/ext/background.js
@@ -652,4 +652,27 @@
/* Storage */
ext.storage = safari.extension.settings;
+
+
+ /* Options */
+
+ ext.showOptions = function(callback)
+ {
+ var optionsUrl = safari.extension.baseURI + "options.html";
+
+ for (var id in pages)
+ {
+ var page = pages[id];
+
+ if (page.url == optionsUrl && page._tab.browserWindow == safari.application.activeBrowserWindow)
+ {
+ page.activate();
+ if (callback)
+ callback(page);
+ return;
+ }
+ }
+
+ ext.pages.open(optionsUrl, callback);
+ };
})();
« no previous file with comments | « popup.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld