aboutsummaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorDeathamns <deathamns@gmail.com>2015-01-08 21:11:43 +0100
committerDeathamns <deathamns@gmail.com>2015-01-13 07:30:00 +0100
commitd0de3d0d72b1015beeb51ba13a84676b66c68083 (patch)
tree4810214b0b6cd234bcf545ed0228d9b0860e53db /platform
parenta31c30d55e128710777a20294155a3ea9ca78947 (diff)
downloaduBlock-d0de3d0d72b1015beeb51ba13a84676b66c68083.zip
uBlock-d0de3d0d72b1015beeb51ba13a84676b66c68083.tar.gz
uBlock-d0de3d0d72b1015beeb51ba13a84676b66c68083.tar.bz2
Firefox,Safari: implement vAPI.tabs.reload
Diffstat (limited to 'platform')
-rw-r--r--platform/firefox/vapi-background.js12
-rw-r--r--platform/safari/vapi-background.js10
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;