Why doesn't window.onload and load event listener work in a content script?

Hi! I am programmatically injecting a content script into the main world with
chrome.scripting.executeScript
chrome.scripting.executeScript
. I am trying to use the following to run my function when DOM has loaded. But it doesn't seem to work, I don't see any console logs at all. Anyone know how I can solve this?
No description
1 Reply
JJC
JJC•2mo ago
The event already happened by the time the extension is opened. I'm not sure if theres any work-around to this. I was also dealing with this issue.
Want results from more Discord servers?
Add your server