Restore old Audio prototype after exportFunction

Authored by broulik on Apr 14 2020, 9:19 AM.

Description

Restore old Audio prototype after exportFunction

exportFunction doesn't carry over a prototype, nor can I assign a non-function with it afterwards.
However, Firefox exports the "unsafe" stuff in wrappedJSObject, so I can actually get the original untrusted prototype,
exportFunction my new function, and then set it back.

I can't just use the prototype in content-script since it wouldn't be accessible from the webpage.
Interestingly enough, I have to use window.Audio rather than window.wrappedJSObject.Audio for creating the player as the
wrapped one doesn't appear to be working when used from this function. This one then still passes onto the website like
normal and plays sound.

BUG: 414512

Differential Revision: https://phabricator.kde.org/D28706

Details

Committed
broulikApr 14 2020, 9:19 AM
Differential Revision
D28706: Restore old Audio prototype after exportFunction
Parents
R856:f23d65ec6ad7: GIT_SILENT made messages (after extraction)
Branches
Unknown
Tags
Unknown