Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 2.93 KB

File metadata and controls

48 lines (36 loc) · 2.93 KB

Self Destructing Cookies (with Multifox Compatibility)

##Download latest (0.4.101) 🡇

This is just the Self-Destructing Cookies addon for Firefox, modified to not delete cookies belonging to Multifox tabs.

Download signed .xpis at Releases page
IT IS NOW SIGNED THANKS TO SDC USING JPM NOW :D

All code belongs to Ove (sdc@elektro-eel.org) except for the single line I added lol

Info

Really just requires adding a single line to a function in main.js

function checkDomainWhitelist(domain, ignoreSession) {
  // an empty domain indicates a file:// type url, keep those cookies
  if (domain == "") return true;
  if (domain.substr(-9) === ".multifox") { arr = domain.split("."); arr.splice(-2,2); domain = arr.join("."); } //brr
  // XXX assuming that subdomains are automatically whitelisted
  var perm = getDomainWhitelist(domain);
  return (perm == Ci.nsICookiePermission.ACCESS_ALLOW || perm == Ci.nsICookiePermission.ACCESS_ALLOW_FIRST_PARTY_ONLY || (!ignoreSession && perm == Ci.nsICookiePermission.ACCESS_SESSION));
}

the line added is:

if (domain.substr(-9) === ".multifox") { arr = domain.split("."); arr.splice(-2,2); domain = arr.join("."); } //brr

I know it's not perfect. If a tab is open with cookie github.heygears.com.github-com-2.multifox and a tab is open with cookie github.com and the multifox tab is closed, it's cookies will remain as long as the non-multifox github.com tab is open as all the modification does is strip the multifox suffix when checking cookies agains the whitelist of open tabs. But at least it makes browsing with Multifox+SDC not annoying by not deleting cookies which are being used.

Modifying the extension yourself

This is recommended if you don't trust me. All I am doing is uploading the contents of another person's extension with a single line changed which you can do yourself.

  1. Visit the Self-destructing Cookies addon page
  2. Right click on the install button and Save As
  3. Extract the .xpi contents with an archive manager (its just a zip)
  4. Add the line mentioned above to \resources\self-destructing-cookies\lib\main.js
  5. Delete the META-INF folder
  6. Edit package.json and install.rdf to reflect your new addon ID, title and version
  7. jpm xpi
  8. jpm sign --api-key (your key) --api-secret (your secret) --xpi (your xpi)
  9. Drag signed .xpi into firefox

License

GNU General Public License, version 2.0 (Original license of SDC)