Skip to content

Commit

Permalink
Remove innerHTML call and replace with textContent (#6916)
Browse files Browse the repository at this point in the history
* Remove innerHTML call

* Update to innerText

* Update comment to say innerText

* replace innerText with textContent

* Updating comment to textContent

* Add changeset

* Reword changeset
  • Loading branch information
dwyfrequency authored Jan 10, 2023
1 parent 50b8191 commit a405663
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-carrots-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/database': patch
---

Replace `innerHTML` call with `textContent`.
4 changes: 2 additions & 2 deletions packages/database/src/realtime/BrowserPollConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a405663

Please sign in to comment.