My extension needs to periodically send some data (in the background) to a server with user authentication information from FB. Therefore, I clearly need to send an FB token with data.
Now I open https://www.facebook.com/dialog/oauth?client_id=<APP_ID>&response_type=token&redirect_uri=http://www.facebook.com/connect/login_success.htmlin a new tab, and then extract the token from the hash (using the background image), and then save it to localStorage.
But let's say the user closes his browser and opens it after the token expires. How can I get a new version without additional clicks?
source
share