2011-10-29 76 views
3

作爲後續行動,以my previous question,如果用戶點擊我給他在一封電子郵件中這樣如何在background.html(Chrome擴展)中獲取url參數?

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

鏈接是有辦法,我可以得到的URL參數userEmail=confirmedbackground.html

謝謝!

+1

我不知道,如果你可以單獨打開的背景頁。您最好以其他方式將數據發送到後臺頁面。 – pimvdb

+0

@pimvdb,所以上面不會工作呢?還有什麼其他方式可以將信息從應用程序發送到background.html。歡迎任何建議。謝謝。 – Zeynel

+0

該鏈接是否放置了內容腳本?如果是這樣,您可以使用'sendRequest'進行通信:http://code.google.com/chrome/extensions/messaging.html。 – pimvdb

回答

3

你可以使用:

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