From 8f0bdc149339d8933f88530dc2ecae81b58281d1 Mon Sep 17 00:00:00 2001 From: hackademix Date: Thu, 6 Dec 2018 22:51:53 +0100 Subject: Fix restored media element from placeholder not loading previously blocked content. --- src/content/PlaceHolder.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/PlaceHolder.js b/src/content/PlaceHolder.js index ac4dc14..8f31951 100644 --- a/src/content/PlaceHolder.js +++ b/src/content/PlaceHolder.js @@ -144,7 +144,7 @@ var PlaceHolder = (() => { replacement._placeHolderElement = element; - element.parentNode.replaceChild(replacement, element); + element.replaceWith(replacement); this.replacements.add(replacement); } @@ -162,8 +162,8 @@ var PlaceHolder = (() => { return; } try { - var element = replacement._placeHolderElement; - replacement.parentNode.replaceChild(element, replacement); + let element = replacement._placeHolderElement; + replacement.replaceWith(element.cloneNode(true)); this.replacements.delete(replacement); } catch (e) { error(e, "While replacing"); -- cgit v1.2.3