<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, fvogt, ognarb.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28706">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p><tt style="background: #ebebeb; font-size: 13px;">exportFunction</tt> doesn't carry over a prototype, nor can I assign a non-function with it afterwards.<br />
However, Firefox exports the "unsafe" stuff in <tt style="background: #ebebeb; font-size: 13px;">wrappedJSObject</tt>, so I can actually get the original untrusted prototype, <tt style="background: #ebebeb; font-size: 13px;">exportFunction</tt> my new function, and then set it back.<br />
I can't just use the prototype in content-script since it wouldn't be accessible from the webpage.<br />
Interestingly enough, I have to use <tt style="background: #ebebeb; font-size: 13px;">window.Audio</tt> rather than <tt style="background: #ebebeb; font-size: 13px;">window.wrappedJSObject.Audio</tt> for <em>creating</em> the player as the wrapped one doesn't appear to be working when used from this function.<br />
This one then still passes onto the website like normal and plays sound.</p>

<p>BUG: 414512</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>The websites mentioned in the bug report</p>

<ul class="remarkup-list">
<li class="remarkup-list-item"><a href="https://playcanv.as/p/44MRmJRU/" class="remarkup-link" target="_blank" rel="noreferrer">https://playcanv.as/p/44MRmJRU/</a></li>
<li class="remarkup-list-item"><a href="https://robostorm.io/" class="remarkup-link" target="_blank" rel="noreferrer">https://robostorm.io/</a> (without any sound but that is also without p-b-i and in Chrome)</li>
</ul>

<p>work now</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R856 Plasma Browser Integration</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28706">https://phabricator.kde.org/D28706</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>extension/content-script.js</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, fvogt, ognarb<br /><strong>Cc: </strong>plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>