Code injection into Gmail via a Google Chrome extension - how to make sure that my script gets injected when it has finished loading?
I'm creating a Google Chrome extension that adds some extra functionality to Gmail by injecting a script that I've written. By 'injected script' please see this definition. To do this, my content script matches on ["https://mail.google.com/mail/*"]. However, the problem with this is that this is the same URL for when Gmail is loading and has finished loading. As a result, my script appears to sometimes to get injected too early, while Gmail is still loading, leading to reference errors. To try to circumvent this problem, I'm only running my script on load by doing: window.addEventListener("loa
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.