Store data for bookmarklet

I am doing a bookmarklet that calls the Google App Engine application. The GAE application uses the registration information that I want to store in the bookmarket, therefore, when the user first clicks the bookmarklet, he asks for the login information, but the next time it is automatically transmitted.

+4
source share
2 answers

The complexity of the bookmarklet that directly stores data is that it can only store data in a cookie or in localStore, both of which "belong" to any page on which it is currently included. This means that it will not work again the next time you use it on another page, and also means that the page you are on can access data, which is usually very bad for security.

There are two main ways your situation usually handles it. Two main ways:

1.) The application used allows the user to log in with a cookie. Login information is not stored in a cookie; only session id. This happens when you return to many popular websites, you no longer need to log in. Very often, these types of bookmarks open a small pop-up window for the user containing the page from the application. If the user is not logged in, the application will first prompt the user to log in. This bookmarklet does not actually know anything about whether it was signed or not.

2.) Each bookmarklet is customizable for each person. Thus, my bookmarklet will be different from yours. The difference is simply that mine will contain my registration information in code, and yours will contain your registration information in code. In fact, each of us must first enter the application before we can get our own personalized bookmarklet.

As a rule, option 1 is better, simpler and safer.

+7
source

If I understand correctly, this will help you. http://ajaxian.com/archives/whats-in-a-windowname

It allows you to store data in windowname in JS. Allowing access to data up to 2 MB (much more than cookies), and I believe that they can be used in tabs ...

0
source

Source: https://habr.com/ru/post/1401039/


All Articles