Skip to content
  • Kai Uwe Broulik's avatar
    Restore old Audio prototype after exportFunction · 08468773
    Kai Uwe Broulik authored
    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
    08468773