Resolved issue with Firefox deprecating Element.replaceWholeText()