Zeynel
Zeynel

Reputation: 13515

How to get a url parameter in background.html (Chrome extension)?

As a follow up to my previous question, if a user clicks to a link I sent him in an email like this

<a href="chrome-extension://obilma.../background.html?userEmail=confirmed">click here to confirm your email</a>

is there a way I can get the url parameter userEmail=confirmed in background.html?

Thanks!

Upvotes: 3

Views: 835

Answers (1)

David Thomas
David Thomas

Reputation: 253318

You could use:

var query = window.location.toString().substring(window.location.toString().indexOf('=')+1);
alert(query);

Upvotes: 3

Related Questions