Copy attributes from hijacked Flash objects

This commit is contained in:
David Wendt 2019-08-20 13:00:47 -06:00
parent 0414e24ce2
commit 6f32fc022c
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,12 @@ class RuffleObjectShadow {
this.params = RuffleObjectShadow.params_of(elem); this.params = RuffleObjectShadow.params_of(elem);
this.oldelem = elem; this.oldelem = elem;
this.elem = document.createElement("div"); this.elem = document.createElement("div");
for (let attrib of this.oldelem.attributes) {
if (attrib.specified) {
this.elem.setAttribute(attrib.name, attrib.value);
}
}
this.shadow = this.elem.attachShadow({mode: 'closed'}); this.shadow = this.elem.attachShadow({mode: 'closed'});
this.shadow.appendChild(ruffle_tmpl.content.cloneNode(true)); this.shadow.appendChild(ruffle_tmpl.content.cloneNode(true));