After carefully looking at the Secret Agent add-on and trying unsuccessfully to contact the developer because of an issue it has with clearing the general.useragent.override.<domain> preferences, plus it appears to sniff and modify EVERY HTTP request, I decided to attempt to develop a PM only alternative add-on. However, this is my first foray into this area and I would appreciate some help/guidance. I have been trying to find help by searching, but resources on developing an add-on seem to be scarce and/or clear as mud.
Specifically, at the moment, I need help for the following issues:
- 1) Is there a particular event that is fired when all tabs are closed? This would seem to be related to the browser.tabs.closeWindowWithLastTab preference. What I want is a way to tell if all active tabs/pages have been closed so only the home/start/blank page is active. I could try to keep track of what pages are opened and when they all are closed to do what I want in item 2 instead, but this seems chancy.
- 2) If such detection is possible, then is there a way to call whatever does the privacy.clearOnShutdown preference? What I want is to clear history automatically when I detect the event in my first item. This is to as unobtrusively as possible handle ETag fingerprinting by eliminating them when it is reasonable to do so - when no pages are currently active. This would also seem to be the most reasonable time to do a random user agent change.
- 3) A different approach would be if it is possible to eliminate all history (cache, cookies, etc.) of a specific domain when that domain is left, but I hold little hope for that. If such is possible, then I could selectively clear history when a domain is left.
I have the basic flow mapped for what I want to do, but trying to find these specific browser internal API's etc, is difficult at best. If someone is already doing this, I have no pride of authorship and will be glad to discuss my concepts and what I have done so far. In that regard, most of the random user agent changers seem to take a shotgun approach with having dozens of unique user agents that are switched out with every page load, but this is defeating the purpose of trying to blend in! Looking at desktop browser statistics, only THREE browsers would seem to be necessary: Chrome, Firefox, and one other cross-platform one like Opera or Vivaldi. Using the last 5 versions would seem to be adequate, with using Windows 7, 8.1, and 10 (32, WOW, 64), Mac 10.11.6, 10.12.1, 10.12.2, and 12.3, Linux i686, i686 on x86_64, and x86_64.
I realize there are very sophisticated methods of browser fingerprinting, but as the default general.useragent.override.<domain> preferences shows, even the big guys like Google, Facebook, etc. aren't fully beyond using the user agent string.
Thanks for any assistance in advance. Even telling me it is a waste of time with a good explanation as to why would be appreciated!