网站更新内容:请访问: https://bigdata.ministep.cn/

Chrome extension onload behaviour

[Solved] Javascript Chrome extension onload behaviour - Code Redirect]

document.addEventListener("DOMContentLoaded", function () {
    console.log(document.domain);//It outputs id of extension to console
    chrome.tabs.query({ //This method output active URL 
        "active": true,
        "currentWindow": true,
        "status": "complete",
        "windowType": "normal"
    }, function (tabs) {
        for (tab in tabs) {
            console.log(tabs[tab].url);
        }
    });
});
posted @ 2021-11-18 20:21  ministep88  阅读(24)  评论(0编辑  收藏  举报
网站更新内容:请访问:https://bigdata.ministep.cn/