Skip to content

The `Self-Destructing Cookies' addon for Firefox, modified to not delete cookies belonging to Multifox tabs

Notifications You must be signed in to change notification settings

berrythesoftwarecodeprogrammar/Self-Destructing-Cookies-with-Multifox-Compatibility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 

Repository files navigation

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 ([email protected]) 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.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)

About

The `Self-Destructing Cookies' addon for Firefox, modified to not delete cookies belonging to Multifox tabs

Resources

Stars

Watchers

Forks

Packages

No packages published