From a4056634a5119dd3f2ca935cae23b90fc99d84ee Mon Sep 17 00:00:00 2001 From: dwyfrequency Date: Tue, 10 Jan 2023 13:51:25 -0500 Subject: [PATCH] Remove innerHTML call and replace with textContent (#6916) * Remove innerHTML call * Update to innerText * Update comment to say innerText * replace innerText with textContent * Updating comment to textContent * Add changeset * Reword changeset --- .changeset/pretty-carrots-kneel.md | 5 +++++ packages/database/src/realtime/BrowserPollConnection.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/pretty-carrots-kneel.md diff --git a/.changeset/pretty-carrots-kneel.md b/.changeset/pretty-carrots-kneel.md new file mode 100644 index 00000000000..3755ea18420 --- /dev/null +++ b/.changeset/pretty-carrots-kneel.md @@ -0,0 +1,5 @@ +--- +'@firebase/database': patch +--- + +Replace `innerHTML` call with `textContent`. diff --git a/packages/database/src/realtime/BrowserPollConnection.ts b/packages/database/src/realtime/BrowserPollConnection.ts index a0b3815b4d7..21396cecc8e 100644 --- a/packages/database/src/realtime/BrowserPollConnection.ts +++ b/packages/database/src/realtime/BrowserPollConnection.ts @@ -547,8 +547,8 @@ export class FirebaseIFrameScriptHolder { if (this.myIFrame) { //We have to actually remove all of the html inside this iframe before removing it from the //window, or IE will continue loading and executing the script tags we've already added, which - //can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this. - this.myIFrame.doc.body.innerHTML = ''; + //can lead to some errors being thrown. Setting textContent seems to be the safest way to do this. + this.myIFrame.doc.body.textContent = ''; setTimeout(() => { if (this.myIFrame !== null) { document.body.removeChild(this.myIFrame);