Bug 20497: Improve support for non-portable mode
This MR tries to improve the patch for the portable mode.
About 5-6 months ago I improved the patch in !300 (closed), but a few parts could be still improved, which I am doing in this MR.
A great objective would be to enable/disable portable mode at runtime, but I think that passing through this ifdef
stage and verify that everything works on base-browser could be a better idea for now. At least we have the complete history for the feature.
Once this MR is accepted, we should cherry-pick base-browser commits also to the base-browser branch.
Part of #20497 (closed), but we probably should not close that yet, because Tor Browser won't support portable mode also with these changes, as we need some improvements also for Bug 13252 and for tor-launcher.
Closes #41535 (closed).