diff options
author | Deathamns <deathamns@gmail.com> | 2015-01-08 21:11:43 +0100 |
---|---|---|
committer | Deathamns <deathamns@gmail.com> | 2015-01-13 07:30:00 +0100 |
commit | d0de3d0d72b1015beeb51ba13a84676b66c68083 (patch) | |
tree | 4810214b0b6cd234bcf545ed0228d9b0860e53db | |
parent | a31c30d55e128710777a20294155a3ea9ca78947 (diff) | |
download | uBlock-d0de3d0d72b1015beeb51ba13a84676b66c68083.zip uBlock-d0de3d0d72b1015beeb51ba13a84676b66c68083.tar.gz uBlock-d0de3d0d72b1015beeb51ba13a84676b66c68083.tar.bz2 |
Firefox,Safari: implement vAPI.tabs.reload
-rw-r--r-- | platform/firefox/vapi-background.js | 12 | ||||
-rw-r--r-- | platform/safari/vapi-background.js | 10 |
2 files changed, 21 insertions, 1 deletions
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); diff --git a/platform/safari/vapi-background.js b/platform/safari/vapi-background.js index 0443435..87d31bf 100644 --- a/platform/safari/vapi-background.js +++ b/platform/safari/vapi-background.js @@ -327,6 +327,16 @@ vAPI.tabs.remove = function(tabIds) { /******************************************************************************/ +vAPI.tabs.reload = function(tabId) { + var tab = this.stack[tabId]; + + if ( tab ) { + tab.url = tab.url; + } +}; + +/******************************************************************************/ + vAPI.tabs.injectScript = function(tabId, details, callback) { var tab; |