javascript – Chrome extension with activation

Question:

I wrote an extension for google chrome and it works.

The popup.html file popup.html lines with the popup.html scripts <script></script> , which will further add functionality on certain pages. Now I want to make sure that only registered users on my site can use the extension's functionality. To do this, it is enough to make an ajax request for one page and get an answer about whether there is a user in the database.

If there is no user, then you need to make sure that the extension does not work, and when viewing the contents of popup.html , so that there are no links or any hints about my scripts.

How to give full access to registered users on my site, and completely deprive unregistered users?

I only need competent instructions, and I'll write the code myself.

Answer:

I only need competent instructions, and I'll write the code myself.

Well, write)) You yourself answered:

To do this, it is enough to make an ajax request for one page and get an answer about whether there is a user in the database.

You make a request to the site, check if there is a user with a login and password in the database, if there is, then answer OK and return the token for authorization in the future. If not in the database, then the answer is NOT OK and display a hint, they say, register and all that.

Scroll to Top