I need to read the browsers URL (specefic to the tab) using javascript. I tried the
var currentURL = window.location;
alert(currentURL.href) ;
It shows chrome://browser/content/browser.xul
instead of the web address.
What should I do to ge开发者_StackOverflowt the web address?
Can someone please help me out with this.
Thanks!
document.location.href OR window.location.href must work !!
Probably already got the answer to this, but simply using document.URL will get you the tab's URL.
javascript:(alert(document.URL))
精彩评论