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);