Ever since this question was raised, it has sparked my curiosity. Recently, at a local GDG meetup, we organized a Chrome extension hackathon where I decided to experiment and put some theories to the test. Here are the findings from my exploration:
A) The challenge of bypassing the extension sandbox proved to be formidable; despite various attempts, I could not access the javascript embedded in the page.
B) One potential solution that showed promise under certain conditions involved using a content-script for code injection. By setting up custom listeners on an existing iframe embed, you can achieve results like the following example:
Insert sample code snippet here
By incorporating a similar approach, you could not only trigger alerts but also relay all events back to your background page for further actions based on event triggers.
C) This strategy becomes ineffective if the video is not embedded within an iframe. When dealing with 'video' or 'object' elements, attempting a similar method resulted in challenges setting up event listeners properly. It's possible that differences in event firing mechanisms hindered establishing the necessary bindings.
D) Another workaround, albeit less practical, involves DOM manipulation to remove an embedded video and re-embed it with enhanced bindings and listeners. However, caution must be exercised as altering the video component could disrupt existing API functionalities on the webpage, leading to unintended consequences within an API-driven web application environment.
I trust that these insights provide useful information for your endeavors.