How to pass url parameter from my application to Chrome extension?

In the Google App Engine application, I want to transfer this user information

user = users.get_current_user() 

to expand Chrome in the url paragraph when the user clicks a button in the application.

How can i do this?

I read about Cross-Origin HMLHttpRequest , but it seems like sending information to the application is not about receiving.

This is a continuation of my other questions on this issue.

0
source share
2 answers

You cannot pass information in the background with a URL parameter like this, but you have several options.

Probably the easiest way to do this is to add script content to the application in your application. Since the content of the script works in the context of your web application, it has access to user data and any other information that you might want to convey.

Then, through Message Passing (see http://code.google.com/chrome/extensions/messaging.html ), you can send a message to the background image with the information you are trying to send.

+1
source

It was a long time ago, but just in case someone stumbles upon it, as I did today.

Sending a user's email as a URL parameter is completely unsafe. Anyone who uses curl or their browser can make requests pretending to be an arbitrary user. If users can change data using their queries or if they cannot see each other's data, you should not follow this approach.

Instead, you should use the GAE cookie-based user service:

+1
source

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


All Articles