From f458fa4adf679e790e5b877c4fa3c76ef75709f9 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 1 Jun 2015 09:00:10 -0400 Subject: [PATCH] code review --- platform/firefox/vapi-background.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index f110f8272..e3b7d1a80 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -528,7 +528,7 @@ vAPI.tabs.open = function(details) { details.url = vAPI.getURL(details.url); } - var win, tab, tabBrowser; + var tab; if ( details.select ) { var URI = Services.io.newURI(details.url, null, null); @@ -558,8 +558,8 @@ vAPI.tabs.open = function(details) { } } - win = Services.wm.getMostRecentWindow('navigator:browser'); - tabBrowser = getTabBrowser(win); + var win = Services.wm.getMostRecentWindow('navigator:browser'); + var tabBrowser = getTabBrowser(win); if ( vAPI.fennec ) { tabBrowser.addTab(details.url, {selected: details.active !== false}); @@ -590,9 +590,9 @@ vAPI.tabs.replace = function(tabId, url) { targetURL = vAPI.getURL(targetURL); } - var tab = tabWatcher.browserFromTabId(tabId); - if ( tab ) { - tabWatcher.browserFromTarget(tab).loadURI(targetURL); + var browser = tabWatcher.browserFromTabId(tabId); + if ( browser ) { + browser.loadURI(targetURL); } };