I am creating a Chrome extension and I can't make call the function to work on the newly opened window.
I cant call alertit().
window.onload = function() {
var buttonn = document.getElementById("startt")
buttonn.addEventListener("click", openerr)
}
function openerr() {
var newwin = window.open(" https://www.instagram.com/explore/people/?hl=fr");
alertit();
};
function alertit() {
alert("wiiii")
}
Edit: Thanks Ivar for editing the question
Your grammar and description is pretty poor, so I'll try and get what you are intending.
So, you are opening a window with your chrome extension, and want to alert on it. This can't be done to my knowledge by calling window.open then directly something else, as they are two seperate things.
To control the new page, I suggest you use a content script: https://developer.chrome.com/extensions/content_scripts#registration
Best of luck