Javascript 获取调用注入脚本的选项卡的url
有个问题。Javascript 获取调用注入脚本的选项卡的url,javascript,google-chrome,google-chrome-extension,Javascript,Google Chrome,Google Chrome Extension,有个问题。 我想获取名为inject script content.js的选项卡的url: My manifest.json: My content.js: 链接的结果http://ya.ru: 但我需要看看这个 http://ya.ru/ http://ya.ru/ http://ya.ru/ 尝试window.top.document.location.href尝试window.top.document.location.href document.addEventList
我想获取名为inject script content.js的选项卡的url: My manifest.json: My content.js: 链接的结果http://ya.ru: 但我需要看看这个
http://ya.ru/
http://ya.ru/
http://ya.ru/
尝试
window.top.document.location.href
尝试window.top.document.location.href
document.addEventListener("beforeload", function(event) {
console.log(document.location.href);
}, true);
http://ya.ru/
http://kiks.yandex.ru/system/fc06.html
http://suggest.yandex.ru/jquery-1-4-2.crossframeajax.html
http://ya.ru/
http://ya.ru/
http://ya.ru/