Skip to content

Commit

Permalink
fix(iframe-fixes): fix bug where removeNode fails due to not being pa…
Browse files Browse the repository at this point in the history
…tched like appendNode attempt #2 (#20)

Fixes #18
  • Loading branch information
silbinarywolf authored Nov 28, 2019
1 parent 348f275 commit df74f0e
Show file tree
Hide file tree
Showing 3 changed files with 3,893 additions and 3,468 deletions.
4 changes: 2 additions & 2 deletions lib/iframe-fixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function overrideSpecIFrameToApplyToAppIFrame(): void {
// end up causing "The node to be removed is not a child of this node." errors.
{
const documentRemoveChild = function <T extends Node>(this: T): T {
return appDocument.appendChild.apply(appDocument, arguments as any) as T;
return appDocument.removeChild.apply(appDocument, arguments as any) as T;
};
if (specDocument.removeChild !== documentRemoveChild) {
specDocument.removeChild = documentRemoveChild;
Expand All @@ -69,7 +69,7 @@ function overrideSpecIFrameToApplyToAppIFrame(): void {
// end up causing "The node to be removed is not a child of this node." errors.
{
const bodyRemoveChild = function <T extends Node>(this: T): T {
return appDocument.appendChild.apply(appDocument, arguments as any) as T;
return appDocument.body.removeChild.apply(appDocument, arguments as any) as T;
};
if (specDocument.body.removeChild !== bodyRemoveChild) {
specDocument.body.removeChild = bodyRemoveChild;
Expand Down
Loading

0 comments on commit df74f0e

Please sign in to comment.