title: How to use pywebview in windowless mode to evaluate javascript
body: <p>I would like to use KATEX to convert a Latex expression into a HTML element. I just want the HTML element and no window. I have found that the pywebview library is a lightweight webviewer that is capable of evaluating javascript expressions.</p>
  <p>From the documentation, instantiating a webview always results in a window. Is it possible to run the webview in windowless mode so that a javascript funtion from the KATEX library can be called?</p>
  <p>The javascript function would be something like:</p>
  <pre><code>var html = katex.renderToString(&quot;c = \\pm\\sqrt{a^2 + b^2}&quot;, {
      throwOnError: false
  });
  </code></pre>
  <p>The files main.py and demo1.html are below:</p>
  <pre class="lang-py prettyprint-override"><code>#main.py
  import webview
  window = webview.create_window('Hello world', 'demo1.html')
  webview.start()
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;katex/katex.css&quot; &gt;
      &lt;script defer src=&quot;katex/katex.min.js&quot; &gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>