Passing query parameters to Chrome Extension

329 views
Skip to first unread message

John Doe

unread,
Sep 4, 2020, 9:05:18 AM9/4/20
to Chromium Extensions
Grettings,
I want to publish a chrome extension, make it Unlisted(Only users with the extension link can see and install it) and then pass some date to that url, i.e. www.webstore.com/myExtension?firstName="John"&lastName="Doe"
And then get those values in the background script and save them using local.sync. Is this even possible?
 

Deco

unread,
Sep 4, 2020, 10:31:04 AM9/4/20
to John Doe, Chromium Extensions
I struggle to understand your question, if you are asking if it's possible to declare the users who would be able to access an unlisted extension (a whitelist) when it's unlisted by passing in their names, the answer is no. The CWS domain cannot be directly emulated even when the extension identifier key is static for directing extension related activities, if it could this would open up numerous security issues.

Your second question is neither possible - this would be a violation of user privacy by being able to scrape the names directly from the request server, and rather is another reason why this isn't implemented.

Your only recourse for implementation is to publish your extension with the Private option, and declare the names of the testers via their details who will be able to access the extension.


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/acbb2d8a-564e-49b2-b186-5ad735c1a4b0n%40chromium.org.

Murilo Mielke

unread,
Sep 8, 2020, 8:20:59 AM9/8/20
to Deco, John Doe, Chromium Extensions
@John Doe,

You could add a context script to said extension that runs when the user hits the /myExtension page. The content script could then read/parse the query string, and then send a message to its background, which in turn would save that data on its localsync.

John Doe

unread,
Sep 8, 2020, 8:29:55 AM9/8/20
to Murilo Mielke, Deco, Chromium Extensions
I did it by having an onInstalled event listener that check if the extension is installed for the first time and the queries the tabs open, an if it finds the chrome/webstore website from which the extension was installed, reads that tabs's url and parses his query parameters. I saved in that url some custom query parameters like the ones described and it seems like the don t get removes if I press enter. So this was as expected
Reply all
Reply to author
Forward
0 new messages