Skip to content

Commit a405663

Browse files
authored
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
1 parent 50b8191 commit a405663

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/pretty-carrots-kneel.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/database': patch
3+
---
4+
5+
Replace `innerHTML` call with `textContent`.

packages/database/src/realtime/BrowserPollConnection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ export class FirebaseIFrameScriptHolder {
547547
if (this.myIFrame) {
548548
//We have to actually remove all of the html inside this iframe before removing it from the
549549
//window, or IE will continue loading and executing the script tags we've already added, which
550-
//can lead to some errors being thrown. Setting innerHTML seems to be the easiest way to do this.
551-
this.myIFrame.doc.body.innerHTML = '';
550+
//can lead to some errors being thrown. Setting textContent seems to be the safest way to do this.
551+
this.myIFrame.doc.body.textContent = '';
552552
setTimeout(() => {
553553
if (this.myIFrame !== null) {
554554
document.body.removeChild(this.myIFrame);

0 commit comments

Comments
 (0)