Skip to content

How to open a new window without triggering pop-up blockers

License

Notifications You must be signed in to change notification settings

mpalmer685/pop-up-blocker-demo

Repository files navigation

pop-up-blocker-demo

This repo demonstrates various methods for navigating a user to a new window without triggering a popup blocker, particularly when you need to wait for an async operation like requesting an auth token.

Read the blog post for more details.

Preview

Open this example on CodeSandbox.

Relevant files

  • admin/index.tsx - Defines LoginWithGet and LoginWithPost components, which handle opening a new window and making the auth token request.
  • admin/login-as.tsx - For the GET request, this file acts as a placeholder for your user. For the POST request, this also handles submitting the POST request once the auth token has been fetched.
  • app/api/login.ts - Handles both GET and POST requests to log into the "main" app.

About

How to open a new window without triggering pop-up blockers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published