Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Synzvato/decentraleyes
  • gkrishnaks/decentraleyes
  • ExE-Boss/decentraleyes
  • whtsky/decentraleyes
  • grtgarrett/decentraleyes
  • An_dz/decentraleyes
  • Alaska/decentraleyes
  • finn/decentraleyes
  • klippy/decentraleyes
9 results
Show changes
Showing
with 0 additions and 651 deletions
images/icons/action/default/19.png

713 B

images/icons/action/default/32.png

1.15 KiB

images/icons/action/default/36.png

1.27 KiB

images/icons/action/default/38.png

1.33 KiB

images/icons/action/default/64.png

2.14 KiB

images/icons/action/disabled/16.png

540 B

images/icons/action/disabled/18.png

596 B

images/icons/action/disabled/19.png

629 B

images/icons/action/disabled/32.png

1 KiB

images/icons/action/disabled/36.png

1.12 KiB

images/icons/action/disabled/38.png

1.16 KiB

images/icons/action/disabled/64.png

1.88 KiB

images/icons/extension/128.png

7.67 KiB

images/icons/extension/16.png

608 B

images/icons/extension/48.png

2.77 KiB

images/icons/extension/96.png

5.6 KiB

/**
* Data Handler
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-05-30
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Imports
*/
var { Cc, Ci } = require('chrome');
var self = require('sdk/self');
//noinspection JSUnresolvedFunction
var ioService = Cc['@mozilla.org/network/io-service;1']
.getService(Ci.nsIIOService);
/**
* Absolute resource file paths.
* @var {object} files
*/
var files = require('./files');
/**
* Constants
*/
const DELIVERY_NOTICE = '/**\n * Local delivery by Decentraleyes (' + self.version + ').\n */\n\n';
/**
* Variables
*/
var resourceData = self.data;
/**
* Public Methods
*/
function getRedirectionURI(targetPath, characterSet, type) {
var data, dataURI, redirectionURI;
data = _loadResource(targetPath);
dataURI = _buildDataURI(type, characterSet, data);
redirectionURI = ioService.newURI(dataURI, null, null);
return redirectionURI;
}
/**
* Exports
*/
exports.getRedirectionURI = getRedirectionURI;
/**
* Private Methods
*/
function _loadResource(targetPath) {
var resource;
// Find the result inside a static path index.
if (!files[targetPath]) {
throw new Error('The requested resource is missing.');
}
// Attempt to load resource contents.
return resource = resourceData.load(targetPath);
}
function _buildDataURI(type, characterSet, data) {
var addNotice, dataURI;
//noinspection JSUnresolvedVariable
addNotice = require('sdk/simple-prefs').prefs.addNotice;
dataURI = 'data:' + type + ';charset=' + characterSet + ',';
if (!addNotice) {
dataURI = dataURI + encodeURIComponent(data);
} else {
dataURI = dataURI + encodeURIComponent(DELIVERY_NOTICE + data);
}
return dataURI;
}
/**
* Files
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-07-24
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Files
*/
var files = {
// AngularJS
'resources/angularjs/1.0.1/angular.min.js.dec': true,
'resources/angularjs/1.0.2/angular.min.js.dec': true,
'resources/angularjs/1.0.3/angular.min.js.dec': true,
'resources/angularjs/1.0.4/angular.min.js.dec': true,
'resources/angularjs/1.0.5/angular.min.js.dec': true,
'resources/angularjs/1.0.6/angular.min.js.dec': true,
'resources/angularjs/1.0.8/angular.min.js.dec': true,
'resources/angularjs/1.2.0/angular.min.js.dec': true,
'resources/angularjs/1.2.1/angular.min.js.dec': true,
'resources/angularjs/1.2.10/angular.min.js.dec': true,
'resources/angularjs/1.2.15/angular.min.js.dec': true,
'resources/angularjs/1.2.16/angular.min.js.dec': true,
'resources/angularjs/1.2.20/angular.min.js.dec': true,
'resources/angularjs/1.2.23/angular.min.js.dec': true,
'resources/angularjs/1.2.26/angular.min.js.dec': true,
'resources/angularjs/1.2.28/angular.min.js.dec': true,
'resources/angularjs/1.2.29/angular.min.js.dec': true,
'resources/angularjs/1.3.0/angular.min.js.dec': true,
'resources/angularjs/1.3.3/angular.min.js.dec': true,
'resources/angularjs/1.3.8/angular.min.js.dec': true,
'resources/angularjs/1.3.10/angular.min.js.dec': true,
'resources/angularjs/1.3.11/angular.min.js.dec': true,
'resources/angularjs/1.3.14/angular.min.js.dec': true,
'resources/angularjs/1.3.15/angular.min.js.dec': true,
'resources/angularjs/1.4.0/angular.min.js.dec': true,
'resources/angularjs/1.4.2/angular.min.js.dec': true,
'resources/angularjs/1.4.8/angular.min.js.dec': true,
// Backbone.js
'resources/backbone.js/0.9.0/backbone-min.js.dec': true,
'resources/backbone.js/0.9.1/backbone-min.js.dec': true,
'resources/backbone.js/0.9.2/backbone-min.js.dec': true,
'resources/backbone.js/0.9.9/backbone-min.js.dec': true,
'resources/backbone.js/0.9.10/backbone-min.js.dec': true,
'resources/backbone.js/1.0.0/backbone-min.js.dec': true,
'resources/backbone.js/1.1.0/backbone-min.js.dec': true,
'resources/backbone.js/1.1.1/backbone-min.js.dec': true,
'resources/backbone.js/1.1.2/backbone-min.js.dec': true,
'resources/backbone.js/1.2.0/backbone-min.js.dec': true,
'resources/backbone.js/1.2.1/backbone-min.js.dec': true,
'resources/backbone.js/1.2.2/backbone-min.js.dec': true,
'resources/backbone.js/1.2.3/backbone-min.js.dec': true,
// Dojo
'resources/dojo/1.4.1/dojo/dojo.js.dec': true,
'resources/dojo/1.4.5/dojo/dojo.js.dec': true,
'resources/dojo/1.5.0/dojo/dojo.js.dec': true,
'resources/dojo/1.6.1/dojo/dojo.js.dec': true,
'resources/dojo/1.7.5/dojo/dojo.js.dec': true,
'resources/dojo/1.8.3/dojo/dojo.js.dec': true,
'resources/dojo/1.8.7/dojo/dojo.js.dec': true,
'resources/dojo/1.8.9/dojo/dojo.js.dec': true,
'resources/dojo/1.9.1/dojo/dojo.js.dec': true,
'resources/dojo/1.9.3/dojo/dojo.js.dec': true,
'resources/dojo/1.9.7/dojo/dojo.js.dec': true,
'resources/dojo/1.10.4/dojo/dojo.js.dec': true,
// Ember.js
'resources/ember.js/1.0.1/ember.min.js.dec': true,
'resources/ember.js/1.1.3/ember.min.js.dec': true,
'resources/ember.js/1.2.2/ember.min.js.dec': true,
'resources/ember.js/1.3.2/ember.min.js.dec': true,
'resources/ember.js/1.4.0/ember.min.js.dec': true,
'resources/ember.js/1.5.1/ember.min.js.dec': true,
'resources/ember.js/2.0.0/ember.min.js.dec': true,
'resources/ember.js/2.0.2/ember.min.js.dec': true,
'resources/ember.js/2.1.0/ember.min.js.dec': true,
// Ext Core
'resources/ext-core/3.0.0/ext-core.js.dec': true,
'resources/ext-core/3.1.0/ext-core.js.dec': true,
// jQuery
'resources/jquery/1.2.3/jquery.min.js.dec': true,
'resources/jquery/1.2.6/jquery.min.js.dec': true,
'resources/jquery/1.3.0/jquery.min.js.dec': true,
'resources/jquery/1.3.1/jquery.min.js.dec': true,
'resources/jquery/1.3.2/jquery.min.js.dec': true,
'resources/jquery/1.4.0/jquery.min.js.dec': true,
'resources/jquery/1.4.1/jquery.min.js.dec': true,
'resources/jquery/1.4.2/jquery.min.js.dec': true,
'resources/jquery/1.4.3/jquery.min.js.dec': true,
'resources/jquery/1.4.4/jquery.min.js.dec': true,
'resources/jquery/1.5.0/jquery.min.js.dec': true,
'resources/jquery/1.5.1/jquery.min.js.dec': true,
'resources/jquery/1.5.2/jquery.min.js.dec': true,
'resources/jquery/1.6.0/jquery.min.js.dec': true,
'resources/jquery/1.6.1/jquery.min.js.dec': true,
'resources/jquery/1.6.2/jquery.min.js.dec': true,
'resources/jquery/1.6.3/jquery.min.js.dec': true,
'resources/jquery/1.6.4/jquery.min.js.dec': true,
'resources/jquery/1.7.0/jquery.min.js.dec': true,
'resources/jquery/1.7.1/jquery.min.js.dec': true,
'resources/jquery/1.7.2/jquery.min.js.dec': true,
'resources/jquery/1.8.0/jquery.min.js.dec': true,
'resources/jquery/1.8.1/jquery.min.js.dec': true,
'resources/jquery/1.8.2/jquery.min.js.dec': true,
'resources/jquery/1.8.3/jquery.min.js.dec': true,
'resources/jquery/1.9.0/jquery.min.js.dec': true,
'resources/jquery/1.9.1/jquery.min.js.dec': true,
'resources/jquery/1.10.0/jquery.min.js.dec': true,
'resources/jquery/1.10.1/jquery.min.js.dec': true,
'resources/jquery/1.10.2/jquery.min.js.dec': true,
'resources/jquery/1.11.0/jquery.min.js.dec': true,
'resources/jquery/1.11.1/jquery.min.js.dec': true,
'resources/jquery/1.11.2/jquery.min.js.dec': true,
'resources/jquery/1.11.3/jquery.min.js.dec': true,
'resources/jquery/2.0.0/jquery.min.js.dec': true,
'resources/jquery/2.0.1/jquery.min.js.dec': true,
'resources/jquery/2.0.2/jquery.min.js.dec': true,
'resources/jquery/2.0.3/jquery.min.js.dec': true,
'resources/jquery/2.1.0/jquery.min.js.dec': true,
'resources/jquery/2.1.1/jquery.min.js.dec': true,
'resources/jquery/2.1.3/jquery.min.js.dec': true,
'resources/jquery/2.1.4/jquery.min.js.dec': true,
// jQuery UI
'resources/jqueryui/1.5.3/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.6.0/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.7.3/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.8.24/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.9.2/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.10.4/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.0/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.1/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.2/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.3/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.4/jquery-ui.min.js.dec': true,
// Modernizr
'resources/modernizr/2.6.2/modernizr.min.js.dec': true,
'resources/modernizr/2.7.1/modernizr.min.js.dec': true,
'resources/modernizr/2.7.2/modernizr.min.js.dec': true,
'resources/modernizr/2.8.2/modernizr.min.js.dec': true,
'resources/modernizr/2.8.3/modernizr.min.js.dec': true,
// MooTools
'resources/mootools/1.1.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.1.2/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.3/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.4/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.5/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.3.0/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.3.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.3.2/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.4.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.4.5/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.5.0/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.5.1/mootools-yui-compressed.js.dec': true,
// Prototype
'resources/prototype/1.6.0.2/prototype.js.dec': true,
'resources/prototype/1.6.0.3/prototype.js.dec': true,
'resources/prototype/1.6.1.0/prototype.js.dec': true,
'resources/prototype/1.7.0.0/prototype.js.dec': true,
'resources/prototype/1.7.1.0/prototype.js.dec': true,
'resources/prototype/1.7.2.0/prototype.js.dec': true,
'resources/prototype/1.7.3.0/prototype.js.dec': true,
// Scriptaculous
'resources/scriptaculous/1.8.1/scriptaculous.js.dec': true,
'resources/scriptaculous/1.8.2/scriptaculous.js.dec': true,
'resources/scriptaculous/1.8.3/scriptaculous.js.dec': true,
'resources/scriptaculous/1.9.0/scriptaculous.js.dec': true,
// SWFObject
'resources/swfobject/2.1/swfobject.js.dec': true,
'resources/swfobject/2.2/swfobject.js.dec': true,
// Underscore.js
'resources/underscore.js/1.3.0/underscore-min.js.dec': true,
'resources/underscore.js/1.3.1/underscore-min.js.dec': true,
'resources/underscore.js/1.3.3/underscore-min.js.dec': true,
'resources/underscore.js/1.4.0/underscore-min.js.dec': true,
'resources/underscore.js/1.4.1/underscore-min.js.dec': true,
'resources/underscore.js/1.4.2/underscore-min.js.dec': true,
'resources/underscore.js/1.4.3/underscore-min.js.dec': true,
'resources/underscore.js/1.4.4/underscore-min.js.dec': true,
'resources/underscore.js/1.5.0/underscore-min.js.dec': true,
'resources/underscore.js/1.5.1/underscore-min.js.dec': true,
'resources/underscore.js/1.5.2/underscore-min.js.dec': true,
'resources/underscore.js/1.6.0/underscore-min.js.dec': true,
'resources/underscore.js/1.7.0/underscore-min.js.dec': true,
'resources/underscore.js/1.8.0/underscore-min.js.dec': true,
'resources/underscore.js/1.8.1/underscore-min.js.dec': true,
'resources/underscore.js/1.8.2/underscore-min.js.dec': true,
'resources/underscore.js/1.8.3/underscore-min.js.dec': true,
// Web Font Loader
'resources/webfont/1.0.0/webfont.js.dec': true,
'resources/webfont/1.0.1/webfont.js.dec': true,
'resources/webfont/1.0.2/webfont.js.dec': true,
'resources/webfont/1.0.3/webfont.js.dec': true,
'resources/webfont/1.0.4/webfont.js.dec': true,
'resources/webfont/1.0.5/webfont.js.dec': true,
'resources/webfont/1.0.6/webfont.js.dec': true,
'resources/webfont/1.0.9/webfont.js.dec': true,
'resources/webfont/1.0.10/webfont.js.dec': true,
'resources/webfont/1.0.11/webfont.js.dec': true,
'resources/webfont/1.0.12/webfont.js.dec': true,
'resources/webfont/1.0.13/webfont.js.dec': true,
'resources/webfont/1.0.14/webfont.js.dec': true,
'resources/webfont/1.0.15/webfont.js.dec': true,
'resources/webfont/1.0.16/webfont.js.dec': true,
'resources/webfont/1.0.17/webfont.js.dec': true,
'resources/webfont/1.0.18/webfont.js.dec': true,
'resources/webfont/1.0.19/webfont.js.dec': true,
'resources/webfont/1.0.21/webfont.js.dec': true,
'resources/webfont/1.0.22/webfont.js.dec': true,
'resources/webfont/1.0.23/webfont.js.dec': true,
'resources/webfont/1.0.24/webfont.js.dec': true,
'resources/webfont/1.0.25/webfont.js.dec': true,
'resources/webfont/1.0.26/webfont.js.dec': true,
'resources/webfont/1.0.27/webfont.js.dec': true,
'resources/webfont/1.0.28/webfont.js.dec': true,
'resources/webfont/1.0.29/webfont.js.dec': true,
'resources/webfont/1.0.30/webfont.js.dec': true,
'resources/webfont/1.0.31/webfont.js.dec': true,
'resources/webfont/1.1.0/webfont.js.dec': true,
'resources/webfont/1.1.1/webfont.js.dec': true,
'resources/webfont/1.1.2/webfont.js.dec': true,
'resources/webfont/1.3.0/webfont.js.dec': true,
'resources/webfont/1.4.2/webfont.js.dec': true,
'resources/webfont/1.4.6/webfont.js.dec': true,
'resources/webfont/1.4.7/webfont.js.dec': true,
'resources/webfont/1.4.8/webfont.js.dec': true,
'resources/webfont/1.4.10/webfont.js.dec': true,
'resources/webfont/1.5.0/webfont.js.dec': true,
'resources/webfont/1.5.2/webfont.js.dec': true,
'resources/webfont/1.5.3/webfont.js.dec': true,
'resources/webfont/1.5.6/webfont.js.dec': true,
'resources/webfont/1.5.10/webfont.js.dec': true,
'resources/webfont/1.5.18/webfont.js.dec': true
};
/**
* Exports
*/
module.exports = files;
/**
* Interceptor
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-05-30
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Imports
*/
var { Class } = require('sdk/core/heritage');
var { Unknown } = require('sdk/platform/xpcom');
var { Cc, Ci, Cr } = require('chrome');
/**
* Gets and sets add-on specific preferences.
* @var {object} simplePreferences
*/
var simplePreferences = require('sdk/simple-prefs');
/**
* Retains data across Firefox restarts.
* @var {object} simpleStorage
*/
var simpleStorage = require('sdk/simple-storage');
//noinspection JSUnresolvedFunction
var observerService = Cc['@mozilla.org/observer-service;1']
.getService(Ci.nsIObserverService);
var requestAnalyzer = require('./request-analyzer');
var dataHandler = require('./data-handler');
/**
* Variables
*/
var preferences = simplePreferences.prefs;
var storage = simpleStorage.storage;
/**
* Interceptor Class
*/
var Interceptor = new Class({
extends: Unknown,
interfaces: ['nsIObserver'],
topic: 'http-on-modify-request',
register: function () {
observerService.addObserver(this, this.topic, false);
},
unregister: function () {
observerService.removeObserver(this, this.topic);
},
/**
* Called whenever an HTTP request is made.
* @param httpChannel
*/
observe: function (httpChannel) {
var validCandidate, target, characterSet, redirectionURI;
// Enable runtime discovery.
httpChannel.QueryInterface(Ci.nsIHttpChannel);
// Determine the validity of the candidate.
validCandidate = requestAnalyzer.isValidCandidate(httpChannel);
if (!validCandidate) {
return;
}
// Remove referer header from request.
httpChannel.setRequestHeader('Referer', null, false);
// Convert the original request URI to a local target.
target = requestAnalyzer.getLocalTarget(httpChannel.URI.host, httpChannel.URI.path);
if (!target) {
return this.handleMissingCandidate(httpChannel);
}
characterSet = httpChannel.URI.originCharset;
// Fetch local data and create a redirection URI.
try {
redirectionURI = dataHandler.getRedirectionURI(target.path, characterSet, target.type);
} catch (exception) {
return this.handleMissingCandidate(httpChannel);
}
// Fix for reported edge-case issues with specific websites.
var initiatorDomain =
httpChannel.loadInfo && httpChannel.loadInfo.loadingDocument && httpChannel.loadInfo.loadingDocument.domain ||
httpChannel.referrer && httpChannel.referrer.host;
if (storage.taintedDomains[initiatorDomain]) {
return this.handleMissingCandidate(httpChannel);
}
// Redirect the HTTP channel to the the local destination.
httpChannel.redirectTo(redirectionURI);
//noinspection JSUnresolvedVariable
preferences.amountInjected++;
},
/**
* Called when a valid candidate cannot be injected.
* @param httpChannel
*/
handleMissingCandidate: function (httpChannel) {
//noinspection JSUnresolvedVariable
if (preferences.blockMissing) {
httpChannel.cancel(Cr.NS_ERROR_NOT_AVAILABLE);
}
}
});
/**
* Exports
*/
module.exports = Interceptor;
/**
* Load Watcher
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2016-02-04
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Imports
*/
var { Class } = require('sdk/core/heritage');
var { Unknown, Factory } = require('sdk/platform/xpcom');
var { Cc, Ci, Cu } = require('chrome');
var xpcom = require('sdk/platform/xpcom');
/**
* Resource version mappings.
* @var {object} mappings
*/
var mappings = require('./mappings');
/**
* Retains data across Firefox restarts.
* @var {object} simpleStorage
*/
var simpleStorage = require('sdk/simple-storage');
//noinspection JSUnresolvedFunction
var categoryManager = Cc['@mozilla.org/categorymanager;1']
.getService(Ci.nsICategoryManager);
/**
* Constants
*/
const CONTRACT_ID = '@decentraleyes.org/load-watcher;1';
const SCRIPT_CONTENT_TYPE = Ci.nsIContentPolicy.TYPE_SCRIPT;
const HTML_DOCUMENT = Ci.nsIDOMHTMLDocument;
const SCRIPT_ELEMENT = Ci.nsIDOMHTMLScriptElement;
const REQUEST_ACCEPTATION = Ci.nsIContentPolicy.ACCEPT;
/**
* Variables
*/
var storage = simpleStorage.storage;
/**
* Initializations
*/
storage.taintedDomains = storage.taintedDomains || {};
/**
* Load Watcher Class
*/
var LoadWatcher = new Class({
extends: Unknown,
interfaces: ['nsIContentPolicy'],
get wrappedJSObject() { return this },
register: function () {
categoryManager.deleteCategoryEntry('content-policy', CONTRACT_ID, false);
categoryManager.addCategoryEntry('content-policy', CONTRACT_ID, CONTRACT_ID, false, true);
},
shouldLoad: function (contentType, contentLocation, requestOrigin, node) {
if (contentType == SCRIPT_CONTENT_TYPE && mappings[contentLocation.host]) {
if (node instanceof SCRIPT_ELEMENT) {
if (node.hasAttribute('crossorigin') || node.hasAttribute('integrity')) {
// Add corresponding origin domain to the list of tainted domains.
storage.taintedDomains[requestOrigin.host] = true;
}
} else if (node instanceof HTML_DOCUMENT) {
if (node.defaultView && node.defaultView.frameElement) {
if (node.defaultView.frameElement.tagName === 'IFRAME') {
// Add corresponding origin domain to the list of tainted domains.
storage.taintedDomains[requestOrigin.host] = true;
}
}
}
}
// Accept the resource load request.
return REQUEST_ACCEPTATION;
}
});
/**
* Load Watcher Factory
*/
var factory = Factory({
contract: CONTRACT_ID,
Component: LoadWatcher,
unregister: false
});
/**
* Unregister
*/
var unload = require('sdk/system/unload');
unload.when(function () {
function trueUnregister() {
categoryManager.deleteCategoryEntry('content-policy', CONTRACT_ID, false);
try {
xpcom.unregister(factory);
} catch (exception) {
Cu.reportError(exception);
}
}
if ('dispatch' in Cu) {
Cu.dispatch(trueUnregister, trueUnregister);
} else {
Cu.import('resource://gre/modules/Services.jsm');
Services.tm.mainThread.dispatch(trueUnregister, 0);
}
});
/**
* Exports
*/
module.exports = LoadWatcher;