1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Web engine | pywebview</title>
<meta name="generator" content="VuePress 1.9.7">
<meta name="description" content="Build GUI for your Python program with JavaScript, HTML, and CSS">
<link rel="preload" href="/3.7/assets/css/0.styles.28a501df.css" as="style"><link rel="preload" href="/3.7/assets/js/app.10a559eb.js" as="script"><link rel="preload" href="/3.7/assets/js/2.0ff7ef1d.js" as="script"><link rel="preload" href="/3.7/assets/js/61.cd0f1d68.js" as="script"><link rel="prefetch" href="/3.7/assets/js/10.f125ec08.js"><link rel="prefetch" href="/3.7/assets/js/11.81fead78.js"><link rel="prefetch" href="/3.7/assets/js/12.0a86c191.js"><link rel="prefetch" href="/3.7/assets/js/13.c09145fc.js"><link rel="prefetch" href="/3.7/assets/js/14.2a7dc35b.js"><link rel="prefetch" href="/3.7/assets/js/15.90c9f36a.js"><link rel="prefetch" href="/3.7/assets/js/16.69b1f4b4.js"><link rel="prefetch" href="/3.7/assets/js/17.956ed884.js"><link rel="prefetch" href="/3.7/assets/js/18.bd6678a0.js"><link rel="prefetch" href="/3.7/assets/js/19.b31e62b7.js"><link rel="prefetch" href="/3.7/assets/js/20.cebc4a71.js"><link rel="prefetch" href="/3.7/assets/js/21.d2041966.js"><link rel="prefetch" href="/3.7/assets/js/22.2a3916f2.js"><link rel="prefetch" href="/3.7/assets/js/23.712fbf84.js"><link rel="prefetch" href="/3.7/assets/js/24.f768e66b.js"><link rel="prefetch" href="/3.7/assets/js/25.69b3e415.js"><link rel="prefetch" href="/3.7/assets/js/26.6619f84a.js"><link rel="prefetch" href="/3.7/assets/js/27.e2a4e1bf.js"><link rel="prefetch" href="/3.7/assets/js/28.abcc819c.js"><link rel="prefetch" href="/3.7/assets/js/29.c379d080.js"><link rel="prefetch" href="/3.7/assets/js/3.749f6582.js"><link rel="prefetch" href="/3.7/assets/js/30.771e8640.js"><link rel="prefetch" href="/3.7/assets/js/31.547a8393.js"><link rel="prefetch" href="/3.7/assets/js/32.778a82c7.js"><link rel="prefetch" href="/3.7/assets/js/33.6ff70f11.js"><link rel="prefetch" href="/3.7/assets/js/34.ae1b5fb4.js"><link rel="prefetch" href="/3.7/assets/js/35.c5555b94.js"><link rel="prefetch" href="/3.7/assets/js/36.d53c471f.js"><link rel="prefetch" href="/3.7/assets/js/37.bbba2d58.js"><link rel="prefetch" href="/3.7/assets/js/38.5eb30036.js"><link rel="prefetch" href="/3.7/assets/js/39.8cac65fe.js"><link rel="prefetch" href="/3.7/assets/js/4.f2c64e71.js"><link rel="prefetch" href="/3.7/assets/js/40.53182a9c.js"><link rel="prefetch" href="/3.7/assets/js/41.19399765.js"><link rel="prefetch" href="/3.7/assets/js/42.41128068.js"><link rel="prefetch" href="/3.7/assets/js/43.660f3959.js"><link rel="prefetch" href="/3.7/assets/js/44.09d5c6f8.js"><link rel="prefetch" href="/3.7/assets/js/45.4a818eab.js"><link rel="prefetch" href="/3.7/assets/js/46.d1621897.js"><link rel="prefetch" href="/3.7/assets/js/47.7f8f8dec.js"><link rel="prefetch" href="/3.7/assets/js/48.f27d4c39.js"><link rel="prefetch" href="/3.7/assets/js/49.4189d401.js"><link rel="prefetch" href="/3.7/assets/js/5.2a771d7d.js"><link rel="prefetch" href="/3.7/assets/js/50.beff8380.js"><link rel="prefetch" href="/3.7/assets/js/51.8a918a6c.js"><link rel="prefetch" href="/3.7/assets/js/52.92d0105f.js"><link rel="prefetch" href="/3.7/assets/js/53.28701cde.js"><link rel="prefetch" href="/3.7/assets/js/54.2b15d6fb.js"><link rel="prefetch" href="/3.7/assets/js/55.d231c742.js"><link rel="prefetch" href="/3.7/assets/js/56.7e02bbff.js"><link rel="prefetch" href="/3.7/assets/js/57.61e9e46c.js"><link rel="prefetch" href="/3.7/assets/js/58.cc70e253.js"><link rel="prefetch" href="/3.7/assets/js/59.d3f412e7.js"><link rel="prefetch" href="/3.7/assets/js/6.64e1f3ed.js"><link rel="prefetch" href="/3.7/assets/js/60.f4fd7728.js"><link rel="prefetch" href="/3.7/assets/js/62.bf000bcc.js"><link rel="prefetch" href="/3.7/assets/js/63.807edde1.js"><link rel="prefetch" href="/3.7/assets/js/64.2b6fe843.js"><link rel="prefetch" href="/3.7/assets/js/7.779cbcff.js"><link rel="prefetch" href="/3.7/assets/js/8.66fb3acb.js"><link rel="prefetch" href="/3.7/assets/js/9.84350af9.js">
<link rel="stylesheet" href="/3.7/assets/css/0.styles.28a501df.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/3.7/" class="home-link router-link-active"><img src="/3.7/logo-no-text.png" alt="pywebview" class="logo"> <span class="site-name can-hide">pywebview</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/3.7/guide/" class="nav-link router-link-active">
Guide
</a></div><div class="nav-item"><a href="/3.7/examples/" class="nav-link">
Examples
</a></div><div class="nav-item"><a href="/3.7/contributing/" class="nav-link">
Contributing
</a></div><div class="nav-item"><a href="/3.7/blog/" class="nav-link">
Blog
</a></div><div class="nav-item"><a href="/3.7/CHANGELOG.html" class="nav-link">
Changelog
</a></div> <a href="https://github.com/r0x0r/pywebview" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/3.7/guide/" class="nav-link router-link-active">
Guide
</a></div><div class="nav-item"><a href="/3.7/examples/" class="nav-link">
Examples
</a></div><div class="nav-item"><a href="/3.7/contributing/" class="nav-link">
Contributing
</a></div><div class="nav-item"><a href="/3.7/blog/" class="nav-link">
Blog
</a></div><div class="nav-item"><a href="/3.7/CHANGELOG.html" class="nav-link">
Changelog
</a></div> <a href="https://github.com/r0x0r/pywebview" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Basics</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/3.7/guide/installation.html" class="sidebar-link">Installation</a></li><li><a href="/3.7/guide/usage.html" class="sidebar-link">Usage</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Development</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/3.7/guide/api.html" class="sidebar-link">API</a></li><li><a href="/3.7/guide/architecture.html" class="sidebar-link">Application architecture</a></li><li><a href="/3.7/guide/debugging.html" class="sidebar-link">Debugging</a></li><li><a href="/3.7/guide/interdomain.html" class="sidebar-link">Interdomain communication</a></li><li><a href="/3.7/guide/freezing.html" class="sidebar-link">Freezing</a></li><li><a href="/3.7/guide/security.html" class="sidebar-link">Security</a></li><li><a href="/3.7/guide/virtualenv.html" class="sidebar-link">Virtual environment</a></li><li><a href="/3.7/guide/renderer.html" aria-current="page" class="active sidebar-link">Web engine</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/3.7/guide/renderer.html#gtk-webkit2" class="sidebar-link">GTK WebKit2</a></li><li class="sidebar-sub-header"><a href="/3.7/guide/renderer.html#qtwebkit" class="sidebar-link">QtWebKit</a></li><li class="sidebar-sub-header"><a href="/3.7/guide/renderer.html#edgehtml" class="sidebar-link">EdgeHTML</a></li></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="web-engine"><a href="#web-engine" class="header-anchor">#</a> Web engine</h1> <p>The following renderers are used on each platform</p> <table><thead><tr><th>Platform</th> <th>Code</th> <th>Renderer</th> <th>Provider</th> <th>Browser compatibility</th></tr></thead> <tbody><tr><td>GTK</td> <td>gtk</td> <td>WebKit</td> <td>WebKit2</td> <td></td></tr> <tr><td>macOS</td> <td></td> <td>WebKit</td> <td>WebKit.WKWebView (bundled with OS)</td> <td></td></tr> <tr><td>QT</td> <td>qt</td> <td>WebKit</td> <td>QtWebEngine / QtWebKit</td> <td></td></tr> <tr><td>Windows</td> <td>edgechromium</td> <td>Chromium</td> <td>> .NET Framework 4.6.2 and Edge Runtime installed</td> <td>Ever-green Chromium</td></tr> <tr><td>Windows</td> <td>edgehtml</td> <td>EdgeHTML</td> <td>> .NET Framework 4.6.2 and Windows 10 build 17110</td> <td></td></tr> <tr><td>Windows</td> <td>mshtml</td> <td>MSHTML</td> <td>MSHTML via .NET / System.Windows.Forms.WebBrowser</td> <td>IE11 (Windows 10/8/7)</td></tr> <tr><td>Windows</td> <td>cef</td> <td>CEF</td> <td>CEF Python</td> <td>Chrome 66</td></tr></tbody></table> <p>On Windows renderer is chosen in the following order: <code>edgechromium</code>, <code>edgehtml</code>, <code>mshtml</code>. <code>mshtml</code> is the only renderer that is guaranteed to be available on any system. Note that Edge Runtime must be installed in order to use Edge Chromium on Windows. You can download it from <a href="https://developer.microsoft.com/en-us/microsoft-edge/webview2/" target="_blank" rel="noopener noreferrer">here<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>. Distribution guidelines are found <a href="https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution" target="_blank" rel="noopener noreferrer">here<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>.</p> <p>To change a default renderer set either <code>PYWEBVIEW_GUI</code> environment variable or pass the rendered value to <code>webview.start(gui=code)</code> function parameter. Check for available values in the Code column from the table above.</p> <p>For example to use CEF on Windows</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token assign-left variable">PYWEBVIEW_GUI</span><span class="token operator">=</span>cef
</code></pre></div><p>or</p> <div class="language-python extra-class"><pre class="language-python"><code><span class="token keyword">import</span> webview
webview<span class="token punctuation">.</span>start<span class="token punctuation">(</span>gui<span class="token operator">=</span><span class="token string">'cef'</span><span class="token punctuation">)</span>
</code></pre></div><p>If you wish to pass custom settings to CEF, refer to <a href="/3.7/examples/cef.html">this example</a></p> <p>To force QT on Linux systems</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token assign-left variable">PYWEBVIEW_GUI</span><span class="token operator">=</span>qt
</code></pre></div><p>or</p> <div class="language-python extra-class"><pre class="language-python"><code><span class="token keyword">import</span> webview
webview<span class="token punctuation">.</span>start<span class="token punctuation">(</span>gui<span class="token operator">=</span><span class="token string">'qt'</span><span class="token punctuation">)</span>
</code></pre></div><h1 id="known-issues-and-limitations"><a href="#known-issues-and-limitations" class="header-anchor">#</a> Known issues and limitations</h1> <h2 id="gtk-webkit2"><a href="#gtk-webkit2" class="header-anchor">#</a> GTK WebKit2</h2> <ul><li>Versions of WebKit2 older than 2.2 has a limitation of 1000 characters of the Javascript result returned by <code>evaluate_js</code>. <code>get_elements</code> is not supported for this reason.</li></ul> <h2 id="qtwebkit"><a href="#qtwebkit" class="header-anchor">#</a> QtWebKit</h2> <ul><li>Debugging is not supported</li></ul> <h2 id="edgehtml"><a href="#edgehtml" class="header-anchor">#</a> EdgeHTML</h2> <ul><li><code>file://</code> URLs are not fully supported. While such URLs can be loaded, associated resources such as images or stylesheets cannot.</li> <li>Destroying a window via <code>window.destroy()</code> and starting a new instance will crash the program.</li> <li>Running the program under elevated privileges will throw an exception.</li> <li>Access to localhost URLs is restricted by default. To overcome this the LoopbackExempt settings are modified on <em>pywebview</em> launch, which triggers a UAC prompt. This only happens once and only if LoopbackExempt setting is not set. You can manually set this setting beforehand to avoid UAC: <code>checknetisolation LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"</code> (must be run as an admin).</li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/r0x0r/pywebview/edit/docs/docs/guide/renderer.md" target="_blank" rel="noopener noreferrer">Help us improve this page!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
←
<a href="/3.7/guide/virtualenv.html" class="prev">
Virtual environment
</a></span> <!----></p></div> </main></div><div class="global-ui"></div></div>
<script src="/3.7/assets/js/app.10a559eb.js" defer></script><script src="/3.7/assets/js/2.0ff7ef1d.js" defer></script><script src="/3.7/assets/js/61.cd0f1d68.js" defer></script>
</body>
</html>
|