我需要使用javascript閱讀瀏覽器URL(標籤爲specefic)。我試過閱讀標籤的當前網址
var currentURL = window.location;
alert(currentURL.href) ;
它顯示chrome://browser/content/browser.xul
而不是網址。 我應該怎麼做才能得到網址?
有人可以幫助我這個。
謝謝!
我需要使用javascript閱讀瀏覽器URL(標籤爲specefic)。我試過閱讀標籤的當前網址
var currentURL = window.location;
alert(currentURL.href) ;
它顯示chrome://browser/content/browser.xul
而不是網址。 我應該怎麼做才能得到網址?
有人可以幫助我這個。
謝謝!
可能已經得到了這個答案,但只是使用document.URL會讓你的標籤的URL。
javascript:(alert(document.URL))
你的意思是在Firefox的擴展? – YOU 2010-03-11 07:17:13
window.location.href不起作用? – 2010-03-11 07:21:17
+1 @Greg K:你應該在答案中寫下這個:) – RubyDubee 2010-03-11 07:42:12