-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The process of creating and navigating the login popup used to involve two steps, first creating a blank window and then navigating it to the final authorization URL. This was needed because, in Firefox, the popup window had to be created in the same turn of the event loop as the user's click on the "Log in" button (otherwise the popup blocker would trigger) but generating the authorization URL involved an async "fetch" of API links. The major browsers have now all settled on a more flexible model for allowing popups in response to user gestures, where the popup must be opened within a certain time window of the gesture. In practice the timeout seems to be ~1000ms in Safari and longer than that in other browsers. In this context we expect the async delay between the user clicking the "Log in" button and us creating the popup to be ~0ms, since the API links should already have been fetched at this point and so we're just fetching locally cached values. Based on this assumption, the flow for creating the login popup window has been simplified to create the popup window at the final URL immediately, removing the need to open a blank window as a first step. Simplifying the code here will make it easier to change how the popup window and sidebar communicate, eg. to resolve an issue with the new Cross-Origin-Opener-Policy header [1]. [1] https://github.com/hypothesis/product-backlog/issues/1333
- Loading branch information
1 parent
14a1cb7
commit b111b63
Showing
4 changed files
with
72 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters