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

Unified Diff: safari/ext/background.js

Issue 29829611: Issue 6786 - Display the Safari App Extension migration page (Closed)
Patch Set: Addressed Sebastian's feedback Created July 13, 2018, 6:41 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 | « background.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
diff --git a/safari/ext/background.js b/safari/ext/background.js
index e1285516406776154d86338e2b40e47d955d0379..02df04739b07994f017bf2fe74a210f88803b13a 100644
--- a/safari/ext/background.js
+++ b/safari/ext/background.js
@@ -588,17 +588,14 @@
/* Options */
-
- ext.showOptions = function(callback)
+ ext.showPage = function(url, callback)
{
- var optionsUrl = safari.extension.baseURI + "options.html";
-
for (var id in pages)
{
var page = pages[id];
var tab = page._tab;
- if (page.url.href == optionsUrl && tab.browserWindow == safari.application.activeBrowserWindow)
+ if (page.url.href == url && tab.browserWindow == safari.application.activeBrowserWindow)
{
tab.activate();
if (callback)
@@ -607,9 +604,11 @@
}
}
- ext.pages.open(optionsUrl, callback);
+ ext.pages.open(url, callback);
};
+ ext.showOptions = ext.showPage.bind(this, safari.extension.baseURI + "options.html");
+
/* Windows */
ext.windows = {
// Safari doesn't provide as rich a windows API as Chrome does, so instead
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld