title: Which is the best way to load a string (HTML code) in TWebBrowser?
body: <p>I have a string var 'HTMLCode' that contains HTML code. I want to load this code into the browser.</p>
  
  <p>This is Embarcadero's code:</p>
  
  <pre><code>procedure THTMLEdit.EditText(CONST HTMLCode: string);
  {VAR
     Doc: IHTMLDocument2;
     TempFile: string; }
  begin
   TempFile := GetTempFile('.html');  
   StringToFile(TempFile, HTMLCode);
   wbBrowser.Navigate(TempFile);
  
   Doc := GetDocument;
   if Doc &lt;&gt; NIL
   then Doc.Body.SetAttribute('contentEditable', 'true', 0);  //crash here when I load complex html files
  
   DeleteFile(TempFile);
  end;
  </code></pre>
  
  <p>It has some <a href="https://stackoverflow.com/questions/39745849/how-stop-twebbrowser-from-adding-file-in-front-of-my-links?noredirect=1#comment66824665_39745849">problems</a> so I replaced it with this one:</p>
  
  <pre><code>procedure THTMLEdit.EditText(CONST HTMLCode: string);
  VAR
     TSL: TStringList;
     MemStream: TMemoryStream;
  begin
   wbBrowser.Navigate('about:blank');
   WHILE wbBrowser.ReadyState &lt; READYSTATE_INTERACTIVE
    DO Application.ProcessMessages;
  
   GetDocument.DesignMode := 'On';
  
   if Assigned(wbBrowser.Document) then
    begin
      TSL := TStringList.Create;
      TRY
        MemStream := TMemoryStream.Create;
        TRY
          TSL.Text := HTMLCode;
          TSL.SaveToStream(MemStream);
          MemStream.Seek(0, 0);
          (wbBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(MemStream));
        FINALLY
          MemStream.Free;
        end;
      FINALLY
        TSL.Free;
      end;
    end;
  end;
  </code></pre>
  
  <p>But this one has problems also . First, when I insert links (...) into the HTML code, the browser will alter the code, <a href="https://stackoverflow.com/questions/39745849/how-stop-twebbrowser-from-adding-file-in-front-of-my-links?noredirect=1#comment66824665_39745849">appending</a> 'about:' in front of my URLs. Second: it is slower than the first procedure (the one with temp file).</p>
  
  <p>Can I load HTML code in browser without navigating first to 'about:blank'?</p>