I'm making a Chrome extension using Angular / Typescript and I'm trying to get the document element by id from the tab that is active and insert a value. On JS is working fine but on TS I don't know how to do it, because "document.getelementbyId" is not working for "HTML ELEMENT"
So, I used this piece of code:
chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
if (changeInfo.status == 'complete' && tab.active) {
if (tab.url == 'https://dashboard.stripe.com/login') {
// THIS IS THE METHOD FOR GET THE ELEMENT BY ID AND IS NOT WORKING
(<HTMLInputElement>document.getElementById('email')).value = "VALUE";
}
}
});
I hope you understand the question and can help me to do it