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);
}
});
});