Skip to content
Permalink
Browse files

Add support for Cookies Manager+ extension

  • Loading branch information...
Infocatcher committed Sep 4, 2012
1 parent 15a227f commit 4fd2f0c634ef83723e91ffbe9f58a7c886a8d32b
Showing with 29 additions and 0 deletions.
  1. +29 −0 Cookies_Permissions/cookiesPermissions.js
@@ -19,6 +19,7 @@ var options = {
preserveCurrentSitesCookies: true
},
showDefaultPolicy: true,
useCookiesManagerPlus: true, // https://addons.mozilla.org/firefox/addon/cookies-manager-plus/
prefillMode: 1, // 0 - move caret to start, 1 - select all, 2 - move caret to end
};

@@ -680,6 +681,11 @@ this.permissions = {
var host = this.options.useBaseDomain.showCookies
? this.currentBaseDomain
: this.currentHost;
if("coomanPlus" in window && "coomanPlusCore" in window && this.options.useCookiesManagerPlus) {
// https://addons.mozilla.org/firefox/addon/cookies-manager-plus/
this.showCookiesCMP(host);
return;
}
if(this.isSeaMonkey) {
this.showCookiesSM(host);
return;
@@ -700,6 +706,29 @@ this.permissions = {
}
this.tweakWindow(win);
},
showCookiesCMP: function(host) {
// See openCMP() function in resource://cookiesmanagerplus/coomanPlusCore.jsm
var win = coomanPlusCore.aWindow;
var _this = this;
var setFilter = function setFilter(e) {
e && win.removeEventListener("load", setFilter, false);
var doc = win.document;
setTimeout(function() { // Just loaded window aren't ready
_this.setTextboxValue(doc.getElementById("lookupcriterium"), host);
}, 0);
};
if(win) {
win.focus();
host && setFilter();
}
else {
win = window.openDialog(
"chrome://cookiesmanagerplus/content/cookiesmanagerplus.xul",
"coomanPlusWindow", "chrome,resizable=yes,toolbar=no,statusbar=no,scrollbar=no,centerscreen"
);
host && win.addEventListener("load", setFilter, false);
}
},
showCookiesSM: function(host) {
var win = this.wm.getMostRecentWindow("mozilla:cookieviewer");
var _this = this;

0 comments on commit 4fd2f0c

Please sign in to comment.
You can’t perform that action at this time.