mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
78
browser/base/content/test/plugins/blocklist_proxy.js
Normal file
78
browser/base/content/test/plugins/blocklist_proxy.js
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
var Cm = Components.manager;
|
||||
|
||||
const kBlocklistServiceUUID = "{66354bc9-7ed1-4692-ae1d-8da97d6b205e}";
|
||||
const kBlocklistServiceContractID = "@mozilla.org/extensions/blocklist;1";
|
||||
const kBlocklistServiceFactory = Cm.getClassObject(Cc[kBlocklistServiceContractID], Ci.nsIFactory);
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
|
||||
/*
|
||||
* A lightweight blocklist proxy for the testing purposes.
|
||||
*/
|
||||
var BlocklistProxy = {
|
||||
_uuid: null,
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsIBlocklistService,
|
||||
Ci.nsITimerCallback]),
|
||||
|
||||
init: function() {
|
||||
if (!this._uuid) {
|
||||
this._uuid =
|
||||
Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID();
|
||||
Cm.nsIComponentRegistrar.registerFactory(this._uuid, "",
|
||||
"@mozilla.org/extensions/blocklist;1",
|
||||
this);
|
||||
}
|
||||
},
|
||||
|
||||
uninit: function() {
|
||||
if (this._uuid) {
|
||||
Cm.nsIComponentRegistrar.unregisterFactory(this._uuid, this);
|
||||
Cm.nsIComponentRegistrar.registerFactory(Components.ID(kBlocklistServiceUUID),
|
||||
"Blocklist Service",
|
||||
"@mozilla.org/extensions/blocklist;1",
|
||||
kBlocklistServiceFactory);
|
||||
this._uuid = null;
|
||||
}
|
||||
},
|
||||
|
||||
notify: function (aTimer) {
|
||||
},
|
||||
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
},
|
||||
|
||||
isAddonBlocklisted: function (aAddon, aAppVersion, aToolkitVersion) {
|
||||
return false;
|
||||
},
|
||||
|
||||
getAddonBlocklistState: function (aAddon, aAppVersion, aToolkitVersion) {
|
||||
return 0; // STATE_NOT_BLOCKED
|
||||
},
|
||||
|
||||
getPluginBlocklistState: function (aPluginTag, aAppVersion, aToolkitVersion) {
|
||||
return 0; // STATE_NOT_BLOCKED
|
||||
},
|
||||
|
||||
getAddonBlocklistURL: function (aAddon, aAppVersion, aToolkitVersion) {
|
||||
return "";
|
||||
},
|
||||
|
||||
getPluginBlocklistURL: function (aPluginTag) {
|
||||
return "";
|
||||
},
|
||||
|
||||
getPluginInfoURL: function (aPluginTag) {
|
||||
return "";
|
||||
},
|
||||
}
|
||||
|
||||
BlocklistProxy.init();
|
||||
addEventListener("unload", () => {
|
||||
BlocklistProxy.uninit();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue