Question

I was wondering if there would be a way to sync settings between the chrome extension on the same user accounts on different computers to only allow one use of the extension at a time.

For example: If someone logged into their chrome store account, downloaded a program on one computer, and then downloaded the same program on the same account on the other computer, would there be a way to only allow use on one of the programs?

Thanks a lot!

PS The app is already on the chrome webstore.

Était-ce utile?

La solution

This sounds like some sort of DRM use case. Setting aside the discussion of whether this is wise, there are a couple approaches:

  • Set an "in use" flag and save it in chrome.storage.sync. If it's already set, then tell the user he's out of luck (or better, force-close the other instance, which will still disappoint the user, but at least he gets to use your product). Hope that no spurious issues occur (such as the user closing the lid of the notebook) that leaves the flag erroneously set on the idle machine.
  • Same idea, but force the user to sign into your own web service. Disallow multiple active sessions.

In either of these cases, you could change the flag to be a timestamp, where the active session periodically renews itself, and you can automatically release a session that's inactive for an hour or so. Then in the lid-closing case, at least the user won't be stranded indefinitely.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top