I’m trying to create an extension for Chrome to control playback using global hotkeys. I’ve faced such problem: somewhere the
elements are not attached to DOM. These elements are audible, but I can’t get them with
document.querySelector('audio') (because it iterates over attached DOM elements only).
Using DevTools I can see these elements:
> queryObjects(HTMLAudioElement) < undefined (3) [audio, audio, audio]
But it's impossible to use this function outside DevTools (it doesn't even return result - this func just prints result to the console).
I'm looking a way to get unattached audio elements from the content_script (or background) of my extension.
document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, ...
- redefine constructor of
document.createElement(failed: extension has its own
'pause'events - they don't bubble
Have any other ideas? Maybe there are some extension-specific capabilities?