Integrate the update check/download/apply steps with torbutton.
Followup from #20778 (closed). Instead of hiding/disabling the UI, torbutton should detect the presence of a sandbox, and integrate the UI with the sandbox's update mechanism.
My current initial plan is to do something like:
- Introduce a new env var
TOR_SANDBOX
that my implementation will set tolinux-v1
. - Modify the
sandboxed-tor-browser
control port surrogate to add: *_TBB_CHECKUPDATE
, a command which will trigger (or display if already in progress) the sandboxed-tor-browser update check.-
_TBB_APPLYUPDATE
, a command which will inform the sandbox that firefox will exit imminently due to user requesting the pending update to apply. -
_TBB_UPDATE
, an event that will fire if there is a browser update pending, and optionally inform the browser that the user requested the update be applied via the sandbox's notification mechanism.
-
- Modify torbutton to (all actions assuming the new env var is set appropriately):
- Send the
_TBB_CHECKUPDATE
command from torbutton_check_for_update() instead of calling into the prompter. - Register for the
_TBB_UPDATE
event, and set extensions.torbutton.updateNeeded to true if it fires (or restart the browser).
- Send the
nb: Since the new command and event are entirely synthetic and never hit the actual tor daemon, I'm not going to bother with a control-spec.txt patch (and since the surrogate doesn't allow events/names as a GETINFO
query, the right way to check if this behavior should happen is "is the env var set to what I said I will set it to".