|
Uploading it to the store , and requiring users to update it. The idea came to make a plugin in the form of a minimal loader that downloads the real plugin file from the server and embeds it into the VKontakte page. Thus, updating the plugin comes down to replacing the file on the server , without the need to rebuild the archive , and for users to update , because the loader does not change. This is especially convenient at the development and testing stage. Also suitable if you need to give different versions to different users. This model of work was approved by Google Chrome , but Opera prohibited it due to security policy. Working from different computers We use social networks from different computers. It would be stupid to have access to notes from only one of them , I want to see notes on every device. The only way to do this is to store notes on the server , and teach the plugin to recognize the user.
While on the VKontakte page , the user is already authorized ; it is enough to find out who photo editing servies exactly. For this, the VKMemos plugin uses the VKontakte API library. Authorization in the plugin is tied to VKontakte authorization. To use the VKontakte API, you need to create an application . Each application receives a secret key. When the plugin is launched for the first time, the user receives a VKontakte pop up window asking for permission. The user only needs to give consent without entering any data. At the same time, in the browser, the VKontakte library generates a hash code based on the user data and the application s secret key. Each request to the server is signed with this hash code.

The server checks requests for authenticity by recreating the hash code on its side and comparing it with the received one. To fake the code, you need to know the user data and the secret key , known only to the application developer. Data synchronization Notes are stored on the server and linked to the VKontakte user. To speed up the work of the plugin, when launched, it downloads all notes and later displays them not from the server , but locally. Notes are always saved to the server. If you have multiple tabs open , changing notes in one of them will save them to the server , but will not update notes from the server in other tabs. To synchronize the work of several tabs.
|
|