作为 my previous question 的跟进,如果用户点击我通过这样的电子邮件发送给他的链接
<a href="chrome-extension://obilma.../background.html?userEmail=confirmed">click here to confirm your email</a>
有没有办法在 background.html
中获取 url 参数 userEmail=confirmed
?
谢谢!
最佳答案
你可以使用:
var query = window.location.toString().substring(window.location.toString().indexOf('=')+1);
alert(query);
关于javascript - 如何在 background.html(Chrome 扩展)中获取 url 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7941524/