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

Unified Diff: chrome/ext/background.js

Issue 29338187: Issue 3696 - Fall back to tabs.create if windows.create isn't available (Closed)
Patch Set: Created March 14, 2016, 7:53 a.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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/ext/background.js
===================================================================
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -594,10 +594,16 @@
ext.windows = {
create: function(createData, callback)
{
- chrome.windows.create(createData, function(createdWindow)
+ if (typeof chrome.windows.create === "function"){
Sebastian Noack 2016/03/14 08:28:17 Nit; it should be sufficient to check for existenc
+ chrome.windows.create(createData, function(createdWindow)
+ {
+ afterTabLoaded(callback)(createdWindow.tabs[0]);
+ });
+ }
+ else
{
- afterTabLoaded(callback)(createdWindow.tabs[0]);
- });
+ ext.pages.open(createData.url, callback);
+ }
}
};
})();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld