Loading
Commits on Source 2
-
TB 43321: Only focus the about:torconnect buttons under certain circumstances. By default, when switching stages we move the focus back to the stage heading. This is because we want to lead the user back to the top of the page to show them the new context. This should help improve the experience when using a screen reader. If we are in the bootstrapping stage we instead move the focus to the "Cancel" button since it is likely that the user wants to use this control. If the user presses the "Cancel" button we return the focus to the "Connect" or "Try a bridge" button. I.e. we restore the prior focus. This allows to user to easily re-try without having to re-read the page they just saw. We do a similar thing when the user cancels the automatic startup bootstrapping. Finally, on page load we will focus the "Connect" button if the user has previously interacted with it. We record this interaction in a preference that persists between sessions. We also separate out the "Loading" stage from the "Start" stage. It is unexpected for `about:torconnect` to be opened whilst in the "Loading" stage, but if it does happen it would be safer to keep the page blank. The way this is implemented also ensures that the initial page is blank prior to "get-init-args" resolving.