Home > Mobile >  How to limit my website to 1 tab (Next.JS)
How to limit my website to 1 tab (Next.JS)

Time:08-07

So I'm a frontend/game developer, so I've decided to make a game.. on a website.

So I've wanted to limit the game to 1 tab as in 2 tabs it would cause some duplication bugs. I've tried searching for this topic but all I found we're questions from 5 years ago and stuff that don't work with Next.JS. May anyone help please?

CodePudding user response:

I would recommend you have the game setup where it requires the user to login. In your database, you can specify an "inGame" field and block the user from starting any new sessions when they try to login.

There is no good way to do this locally, as users could easily get around cookies and local storage by opening a private browser.

  • Related