From 7a5d174aa4f714a0e9f953e348eb2b64da907a63 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 8 Jan 2015 21:11:43 +0100 Subject: [PATCH] Firefox,Safari: implement vAPI.tabs.reload --- platform/firefox/vapi-background.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 6f26f18..dbbaeca 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -410,7 +410,7 @@ vAPI.tabs.get = function(tabId, callback) { } // for internal use - if ( tab && typeof callback !== 'function' ) { + if ( typeof callback !== 'function' ) { return tab; } @@ -561,6 +561,16 @@ vAPI.tabs.remove = function(tabIds) { /******************************************************************************/ +vAPI.tabs.reload = function(tabId) { + var tab = this.get(tabId); + + if ( tab ) { + tab.ownerDocument.defaultView.gBrowser.reloadTab(tab); + } +}; + +/******************************************************************************/ + vAPI.tabs.injectScript = function(tabId, details, callback) { var tab = vAPI.tabs.get(tabId);