Skip to content Skip to sidebar Skip to footer

How Can I Pass An Url Parameter From My App To The Chrome Extension?

In my Google App Engine app I want to pass this user information user = users.get_current_user() to the Chrome extension in a url paramenter when the user clicks a button in t

Solution 1:

You can't pass information to the background via a URL parameter like this, but you've got a couple of options.

Probably the easiest way to do this would be to have the extension inject a content script in to your app. Since the content script runs in the context your your web app, it has access to the user details and any other information you might want to pass.

Then, via Message Passing (see http://code.google.com/chrome/extensions/messaging.html), you could send a message to the background page with the information that you're trying to send.


Solution 2:

This is from a while ago, but just in case someone stumbles upon it as I did today.

Sending the user email as a URL parameter is totally unsafe. Anyone using curl or their browser can make requests pretending to be any random user. If users can alter data with their requests, or if they should not be able to see each others data then you shouldn't follow this approach.

You should use GAE's cookie based user's service instead:


Post a Comment for "How Can I Pass An Url Parameter From My App To The Chrome Extension?"