Bug 1433659 - disable automatic HTML sanitization when creating document fragments in imThemes.jsm, r=clokep.
authorFlorian Quèze <florian@queze.net>
Tue, 30 Jan 2018 16:13:29 +0100
changeset 31001 27bb4a90e0a83c36fd054b63459516307aa4e1fa
parent 31000 d4624bdffc31b8dc5e8ff68ca622b4f4b515831c
child 31002 262a2523f4d34f2318f740297fd8ff3e9c9727c4
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersclokep
bugs1433659
Bug 1433659 - disable automatic HTML sanitization when creating document fragments in imThemes.jsm, r=clokep.
chat/modules/imThemes.jsm
--- a/chat/modules/imThemes.jsm
+++ b/chat/modules/imThemes.jsm
@@ -537,17 +537,19 @@ function insertHTMLForMessage(aMsg, aHTM
   if (insert && !aIsNext) {
     insert.remove();
     insert = null;
   }
 
   let range = aDoc.createRange();
   let parent = insert ? insert.parentNode : aDoc.getElementById("Chat");
   range.selectNode(parent);
+  aDoc.allowUnsafeHTML = true;
   let documentFragment = range.createContextualFragment(aHTML);
+  aDoc.allowUnsafeHTML = false;
   let result = documentFragment.firstChild;
 
   // store the prplIMessage object in each of the "root" node that
   // will be inserted into the document, so that selection code can
   // retrieve the message by just looking at the parent node until it
   // finds something.
   for (let root = result; root; root = root.nextSibling)
     root._originalMsg = aMsg;