aboutsummaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorDeathamns <deathamns@gmail.com>2015-01-12 17:45:09 +0100
committerDeathamns <deathamns@gmail.com>2015-01-13 07:30:05 +0100
commit3522f0414d924afdf4319ed4e5c6e0f6cd7cabc1 (patch)
treeecc46c11534396a7823275ddd3e8d0033d156588 /platform
parente0f214961d2aeec7273ed09c8552e641f440d980 (diff)
downloaduBlock-3522f0414d924afdf4319ed4e5c6e0f6cd7cabc1.zip
uBlock-3522f0414d924afdf4319ed4e5c6e0f6cd7cabc1.tar.gz
uBlock-3522f0414d924afdf4319ed4e5c6e0f6cd7cabc1.tar.bz2
Firefox: remove unloading from vAPI
Diffstat (limited to 'platform')
-rw-r--r--platform/firefox/vapi-background.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js
index 1e7bd97..5c3fb84 100644
--- a/platform/firefox/vapi-background.js
+++ b/platform/firefox/vapi-background.js
@@ -59,7 +59,7 @@ vAPI.app.restart = function() {
// List of things that needs to be destroyed when disabling the extension
// Only functions should be added to it
-vAPI.unload = [];
+cleanupTasks = [];
/******************************************************************************/
@@ -83,7 +83,7 @@ var SQLite = {
'(name TEXT PRIMARY KEY NOT NULL, value TEXT);'
);
- vAPI.unload.push(function() {
+ cleanupTasks.push(function() {
// VACUUM somewhere else, instead on unload?
SQLite.run('VACUUM');
SQLite.db.asyncClose();
@@ -334,7 +334,7 @@ vAPI.tabs.registerListeners = function() {
Services.ww.registerNotification(windowWatcher);
- vAPI.unload.push(function() {
+ cleanupTasks.push(function() {
Services.ww.unregisterNotification(windowWatcher);
for ( var win of vAPI.tabs.getWindows() ) {
@@ -743,7 +743,7 @@ vAPI.messaging.setup = function(defaultHandler) {
this.globalMessageManager.loadFrameScript(this.frameScript, true);
- vAPI.unload.push(function() {
+ cleanupTasks.push(function() {
var gmm = vAPI.messaging.globalMessageManager;
gmm.removeDelayedFrameScript(vAPI.messaging.frameScript);
@@ -966,12 +966,12 @@ var httpObserver = {
var sourceTabId = null;
- // popup candidate (only for main_frame type)
+ // Popup candidate (only for main_frame type)
if ( lastRequest.openerURL ) {
for ( var tab of vAPI.tabs.getAll() ) {
var tabURI = tab.linkedBrowser.currentURI;
- // not the best approach
+ // Not the best approach
if ( tabURI.spec === this.lastRequest.openerURL ) {
sourceTabId = vAPI.tabs.getTabId(tab);
break;
@@ -988,7 +988,7 @@ var httpObserver = {
return;
}
- // if request is not handled we may use the data in on-modify-request
+ // If request is not handled we may use the data in on-modify-request
if ( channel instanceof Ci.nsIWritablePropertyBag ) {
channel.setProperty(
location.host + 'reqdata',
@@ -1040,7 +1040,7 @@ var httpObserver = {
return;
}
- // carry the data on in case of multiple redirects
+ // Carry the data on in case of multiple redirects
if ( newChannel instanceof Ci.nsIWritablePropertyBag ) {
newChannel.setProperty(location.host + 'reqdata', channelData);
}
@@ -1096,7 +1096,7 @@ vAPI.net.registerListeners = function() {
httpObserver.register();
- vAPI.unload.push(function() {
+ cleanupTasks.push(function() {
vAPI.messaging.globalMessageManager.removeMessageListener(
shouldLoadListenerMessageName,
shouldLoadListener
@@ -1171,7 +1171,7 @@ vAPI.toolbarButton.init = function() {
this.closePopup
);
- vAPI.unload.push(function() {
+ cleanupTasks.push(function() {
CustomizableUI.destroyWidget(this.id);
vAPI.messaging.globalMessageManager.removeMessageListener(
location.host + ':closePopup',
@@ -1457,8 +1457,8 @@ vAPI.onLoadAllCompleted = function() {};
// clean up when the extension is disabled
window.addEventListener('unload', function() {
- for ( var unload of vAPI.unload ) {
- unload();
+ for ( var cleanup of cleanupTasks ) {
+ cleanup();
}
// frameModule needs to be cleared too