“chrome.tabs.query”无法执行我的代码

时间:2018-01-15 04:48:57

标签: javascript jquery google-chrome-extension

    function onWindowLoad() {
  chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
    tabUrl  = tabs[0].url;
    alert(tabUrl);//taburl is Successfully displayed in my browser
    $("#txtUrl").val(tabUrl);//This line of code is not implemented
    alert("hello");//cant't alert hello
});

window.onload = onWindowLoad;

请帮帮我:我想把网址拿到网页上,但是在运行代码后没有任何反应,如何处理?

0 个答案:

没有答案