6 |
7 |
8 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/.vuepress/generate-examples.js:
--------------------------------------------------------------------------------
1 | import fs from 'fs';
2 | import path from 'path';
3 |
4 | function extractDescriptionFromPythonCode(code) {
5 | const match = code.match(/(['"]{3}[\s\S]*?['"]{3})/);
6 |
7 | if (match) {
8 | return match[0].replace(/['"]{3}/g, '').trim();
9 | } else {
10 | return '';
11 | }
12 | }
13 |
14 | function removeExtraLineBreaksFromCodeBlock(code) {
15 | return code.replace(/(\r?\n){3,}/g, '\n\n').trim();
16 | }
17 |
18 | function removeCommentsFromPythonCode(code) {
19 | return code.replace(/(^['"]{3}[\s\S]*?['"]{3})/gm, '').trim();
20 | }
21 |
22 | function convertToMarkdown(filePath, outputDirectory) {
23 | try {
24 | const pythonCode = fs.readFileSync(filePath, 'utf8');
25 | const description = extractDescriptionFromPythonCode(pythonCode);
26 | const codeWithoutComments = removeCommentsFromPythonCode(pythonCode);
27 | const codeWithoutExtraLineBreaks = removeExtraLineBreaksFromCodeBlock(codeWithoutComments);
28 | const fileName = path.basename(filePath, '.py');
29 | const markdownFileName = fileName + '.md';
30 | const markdownFilePath = path.join(outputDirectory, markdownFileName);
31 | const title = fileName.replace(/_/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase());
32 | const markdownContent = `# ${title}\n\n${description}\n\n\`\`\`python\n${codeWithoutExtraLineBreaks}\n\`\`\``;
33 | fs.writeFileSync(markdownFilePath, markdownContent);
34 | console.log(`Converted ${filePath} to ${markdownFilePath}`);
35 | } catch (error) {
36 | console.error(`Error converting ${filePath}: ${error.message}`);
37 | }
38 | }
39 |
40 | function generateExamples(directoryPath, outputDirectory) {
41 | if (!fs.existsSync(outputDirectory)) {
42 | fs.mkdirSync(outputDirectory);
43 | }
44 |
45 | fs.readdirSync(directoryPath).forEach(file => {
46 | const filePath = path.join(directoryPath, file);
47 |
48 | if (file.endsWith('.py')) {
49 | convertToMarkdown(filePath, outputDirectory);
50 | }
51 | });
52 | }
53 |
54 | export { generateExamples };
55 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/img/search.83621669.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/10.946430c0.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{189:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"use-cef"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#use-cef","aria-hidden":"true"}},[t._v("#")]),t._v(" Use CEF")]),t._v(" "),a("p",[t._v("To use Chrome Embedded Framework on Windows.")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("gui "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'cef'")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'CEF Example'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}],!1,null,null,null);s.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/13.94ca571d.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[13],{205:function(t,s,e){"use strict";e.r(s);var n=e(0),a=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"debugging"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#debugging","aria-hidden":"true"}},[t._v("#")]),t._v(" Debugging")]),t._v(" "),e("p",[t._v("To open up debugging console, right click on an element and select Inspect.")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Debug window'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" debug"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}],!1,null,null,null);s.default=a.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/15.788bb271.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[15],{184:function(t,s,e){"use strict";e.r(s);var n=e(0),a=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"fullscreen-window"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#fullscreen-window","aria-hidden":"true"}},[t._v("#")]),t._v(" Fullscreen window")]),t._v(" "),e("p",[t._v("Create a fullscreen window.")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create a non-resizable webview window with 800x600 dimensions")]),t._v("\n webview"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Full-screen browser"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://pywebview.flowrl.com/hello"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n fullscreen"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}],!1,null,null,null);s.default=a.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/19.ec102f84.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[19],{180:function(t,e,n){"use strict";n.r(e);var a=n(0),r=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"javascript-evaluation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#javascript-evaluation","aria-hidden":"true"}},[this._v("#")]),this._v(" Javascript evaluation")]),this._v(" "),e("p",[this._v("Evaluate Javascript from Python code.")]),this._v(" "),e("div",{staticClass:"language-import webview extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("import threading\n\n\ndef evaluate_js():\n result = webview.evaluate_js(\n r\"\"\"\n var h1 = document.createElement('h1')\n var text = document.createTextNode('Hello pywebview')\n h1.appendChild(text)\n document.body.appendChild(h1)\n\n document.body.style.backgroundColor = '#212121'\n document.body.style.color = '#f2f2f2'\n\n // Return user agent\n 'User agent:\\n' + navigator.userAgent;\n \"\"\"\n )\n\n print(result)\n\n\nif __name__ == '__main__':\n t = threading.Thread(target=evaluate_js)\n t.start()\n\n webview.create_window('Run custom JavaScript')\n")])])])])}],!1,null,null,null);e.default=r.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/2.06af3526.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{165:function(t,n,e){},166:function(t,n,e){"use strict";var a=e(165);e.n(a).a},186:function(t,n,e){"use strict";e.r(n);var a={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,n){var e=n.props,a=n.slots;return t("span",{class:["badge",e.type,e.vertical]},e.text||a().default)}},r=(e(166),e(0)),i=Object(r.a)(a,void 0,void 0,!1,null,"099ab69c",null);n.default=i.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/25.3af86868.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[25],{174:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"open-url"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#open-url","aria-hidden":"true"}},[t._v("#")]),t._v(" Open URL")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Simple browser'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}],!1,null,null,null);s.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/26.562c94d4.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[26],{173:function(t,a,s){"use strict";s.r(a);var n=s(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"quit-confirmation-dialog"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quit-confirmation-dialog","aria-hidden":"true"}},[t._v("#")]),t._v(" Quit confirmation dialog")]),t._v(" "),s("div",{staticClass:"language-python extra-class"},[s("pre",{pre:!0,attrs:{class:"language-python"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create a standard webview window")]),t._v("\n webview"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Confirm Quit Example'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n confirm_quit"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}],!1,null,null,null);a.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/33.96fe48c6.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[33],{203:function(e,t,n){"use strict";n.r(t);var a=n(0),s=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"debugging"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debugging","aria-hidden":"true"}},[e._v("#")]),e._v(" Debugging")]),e._v(" "),n("p",[e._v("To debug Javascript, set the "),n("code",[e._v("debug")]),e._v(" parameter to "),n("code",[e._v("True")])]),e._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("import")]),e._v(" webview\n\nwebview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("create_window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[e._v("'https://pywebview.flowrl.com'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" debug"),n("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("True")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),n("p",[e._v("This will enable web inspector on macOS, GTK and QT (QTWebEngine only). To open the web inspector, right click on the page and select Inspect. Unfortunately the Trident web engine on Windows has no web inspector and currently there is no way to attach an external debugger. The "),n("code",[e._v("debug")]),e._v(" flag enables Javascript error reporting and right-click context menu on Windows.")]),e._v(" "),n("p",[e._v("You can debug Python code normally using your favorite debugger.")])])}],!1,null,null,null);t.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/34.1503f1f8.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[34],{202:function(e,r,t){"use strict";t.r(r);var n=t(0),o=Object(n.a)({},function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"content"},[e._m(0),e._v(" "),t("p",[e._v("To freeze your application use "),t("a",{attrs:{href:"https://py2app.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer"}},[e._v("py2app"),t("OutboundLink")],1),e._v(" on macOS ans "),t("a",{attrs:{href:"https://www.pyinstaller.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("pyinstaller"),t("OutboundLink")],1),e._v(" on Windows. For a reference setup.py for py2app, look "),t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/blob/master/examples/py2app_setup.py",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("For Pyinstaller you need to include either "),t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/blob/master/webview/lib/WebBrowserInterop.x86.dll",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebBrowserInterop.x86.dll"),t("OutboundLink")],1),e._v(" or "),t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/blob/master/webview/lib/WebBrowserInterop.x64.dll",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebBrowserInterop.x64.dll"),t("OutboundLink")],1),e._v(" depending on whether you build against 32-bit or 64-bit Python. The DLLs bundled with "),t("em",[e._v("pywebview")]),e._v(" and are located in the "),t("code",[e._v("site-packages/webview/lib")]),e._v(" directory. There is currently an effort to provide a hook for pyinstaller that would bundle this DLL automatically, but for now you have to resort to this step.")]),e._v(" "),e._m(1)])},[function(){var e=this.$createElement,r=this._self._c||e;return r("h1",{attrs:{id:"freezing"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#freezing","aria-hidden":"true"}},[this._v("#")]),this._v(" Freezing")])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("em",[this._v("TODO: add Linux freezing guide")])])}],!1,null,null,null);r.default=o.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/37.5656488c.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[37],{197:function(e,t,r){"use strict";r.r(t);var a=r(0),s=Object(a.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),r("p",[e._v("When using a local web server, you must protect your API from unauthorized access. "),r("a",{attrs:{href:"https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)",target:"_blank",rel:"noopener noreferrer"}},[e._v("CSRF attacks"),r("OutboundLink")],1),e._v(" can be a major problem if API is not protected in an adequate matter. Refer to "),r("a",{attrs:{href:"https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet",target:"_blank",rel:"noopener noreferrer"}},[e._v("this document"),r("OutboundLink")],1),e._v(" for API securing approaches. A library like "),r("a",{attrs:{href:"https://flask-seasurf.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer"}},[e._v("flask-seasurf"),r("OutboundLink")],1),e._v(" alongside Flask can be used too.")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"security"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security","aria-hidden":"true"}},[this._v("#")]),this._v(" Security")])}],!1,null,null,null);t.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/39.8b7a8ec5.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[39],{200:function(t,e,n){"use strict";n.r(e);var s=n(0),i=Object(s.a)({},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[this._m(0),this._v(" "),e("p",[this._v("If you create a virtual environment using the built-in Python on macOS, a pywebview window will have issues with keyboard focus and Cmd+Tab. The issue can be avoided by using other Python installation as described "),e("a",{attrs:{href:"https://virtualenv.pypa.io/en/stable/userguide/#using-virtualenv-without-bin-python",target:"_blank",rel:"noopener noreferrer"}},[this._v("here"),e("OutboundLink")],1),this._v(". For example, Python 3 installed via Homebrew](https://brew.sh) does not")]),this._v(" "),this._m(1)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"virtual-environment"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#virtual-environment","aria-hidden":"true"}},[this._v("#")]),this._v(" Virtual environment")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("brew "),e("span",{pre:!0,attrs:{class:"token function"}},[this._v("install")]),this._v(" python3\nvirtualenv pywebview_env -p python3\n")])])])}],!1,null,null,null);e.default=i.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/4.cc18902f.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{199:function(e,t,o){"use strict";o.r(t);var a=o(0),n=Object(a.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[o("p",[e._v("Thanks for considering contributing to pywebview.")]),e._v(" "),o("p",[e._v("Pywebview is a small-time project, which gets updated sporadically whenever time permits. Any help is more than appreciated and the best way to contribute is submitting a pull request. Bug fixes are always welcome. If you wish to submit a new feature, please create an issue and discuss it beforehand.")]),e._v(" "),o("p",[e._v("If you found a bug and want to report it, please test it first in a web-browser that is used by default for your operating system to see if the problem is with your code, rather than pywebview. Do not forget to specify on which platform and pywebview version it occurs.")]),e._v(" "),o("p",[e._v("To support pywebview financially, consider becoming a patron of the project. Pywebview has no corporate backing and financial help is welcomed to keep the project alive.")]),e._v(" "),e._m(0),e._v(" "),o("p",[e._v("For other ways to donate refer to the "),o("router-link",{attrs:{to:"/contributing/donating.html"}},[e._v("donation")]),e._v(" page.")],1)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"center spc-l spc-vertical"},[t("a",{attrs:{href:"https://www.patreon.com/bePatron?u=13226105","data-patreon-widget-type":"become-patron-button"}},[t("img",{attrs:{src:"https://c5.patreon.com/external/logo/become_a_patron_button.png",alt:"Become a Patron!"}})])])}],!1,null,null,null);t.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/40.14c37596.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[40],{167:function(n,w,o){}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/5.b85830ed.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{194:function(e,t,r){"use strict";r.r(t);var i=r(0),s=Object(i.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),r("p",[e._v("If you think you found a bug, verify following steps first")]),e._v(" "),r("ol",[r("li",[e._v("Does the bug occur in a default browser? If so, the problem is with your code, not pywebview")]),e._v(" "),r("li",[e._v("Are you using the latest master? Bug fixes are merged into the master and it may take a while until a new release is deployed to Pypi.")]),e._v(" "),r("li",[e._v("Has it been "),r("a",{attrs:{href:"https://github.com/r0x0r/pywebview/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("reported"),r("OutboundLink")],1),e._v(" already?")])]),e._v(" "),r("p",[e._v("If you verified all the three points and are sure that the issue is caused by pywebview, feel free to submit a new issue. Please remember to specify under which operating system the bug occurs, as well as with other relevant information. In case of Linux, specify a distro you are using.")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"bug-reporting"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bug-reporting","aria-hidden":"true"}},[this._v("#")]),this._v(" Bug reporting")])}],!1,null,null,null);t.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/7.5eeb60d8.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{192:function(t,e,i){"use strict";i.r(e);var n=i(0),a=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"documentation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#documentation","aria-hidden":"true"}},[this._v("#")]),this._v(" Documentation")]),this._v(" "),e("p",[this._v("One way to contribute is to improve documentation on this side. Each page has a 'Help us improve this page' link at the bottom of the page. By clicking the link you can create a pull request with your changes. You need a Github account to edit pages.")])])}],!1,null,null,null);e.default=a.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/8.b9ad99cd.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{191:function(t,e,r){"use strict";r.r(e);var a=r(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("Recurring pledges come perks, like getting email support or featuring your name or logo in the project repository")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),r("p",[r("a",{attrs:{href:"http://bit.ly/2eg2Z5P",target:"_blank",rel:"noopener noreferrer"}},[r("img",{attrs:{src:"/paypal.png",alt:"Paypal"}}),r("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"donating"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#donating","aria-hidden":"true"}},[this._v("#")]),this._v(" Donating")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"recurrring-pledge"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#recurrring-pledge","aria-hidden":"true"}},[this._v("#")]),this._v(" Recurrring pledge")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"center spc-l spc-vertical"},[e("a",{attrs:{href:"https://www.patreon.com/bePatron?u=13226105","data-patreon-widget-type":"become-patron-button"}},[e("img",{attrs:{src:"https://c5.patreon.com/external/logo/become_a_patron_button.png",alt:"Become a Patron!"}})])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"one-time-donations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#one-time-donations","aria-hidden":"true"}},[this._v("#")]),this._v(" One-time donations")])}],!1,null,null,null);e.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/assets/js/9.6a770a26.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{190:function(e,t,r){"use strict";r.r(t);var a=r(0),s=Object(a.a)({},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"content"},[this._m(0),this._v(" "),t("p",[this._v("Here you can find examples demonstrating different aspects of pywebview. For non-trivial examples on how to create a full-grown application refer to the repository.")]),this._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/tree/master/examples/todos",target:"_blank",rel:"noopener noreferrer"}},[this._v("Serverless application"),t("OutboundLink")],1)]),this._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/tree/master/examples/flask_app",target:"_blank",rel:"noopener noreferrer"}},[this._v("Flask-based application"),t("OutboundLink")],1)])])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#examples","aria-hidden":"true"}},[this._v("#")]),this._v(" Examples")])}],!1,null,null,null);t.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/2.4/logo.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/2.4/paypal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/2.4/paypal.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/img/pywebview3.5e63e895.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/assets/img/pywebview3.5e63e895.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/img/search.83621669.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/10.f125ec08.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{410:function(t,e,a){"use strict";a.r(e);var r=a(58),s=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"blog"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#blog"}},[t._v("#")]),t._v(" Blog")]),t._v(" "),a("h3",{attrs:{id:"_2019-07-11-introducing-pywebview-3-0"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2019-07-11-introducing-pywebview-3-0"}},[t._v("#")]),t._v(" "),a("span",{staticClass:"date"},[t._v("2019-07-11")]),t._v(" Introducing pywebview 3.0")]),t._v(" "),a("p",[a("em",[t._v("pywebview")]),t._v(" has reached version 3.0 and has a number of breaking changes."),a("br"),t._v(" "),a("RouterLink",{attrs:{to:"/blog/pywebview3.html"}},[t._v("Read more")])],1)])}),[],!1,null,null,null);e.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/11.81fead78.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[11],{411:function(t,e,o){"use strict";o.r(e);var a=o(58),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("p",[t._v("Thanks for considering contributing to pywebview.")]),t._v(" "),o("p",[t._v("Pywebview is a small-time project, which gets updated sporadically whenever time permits. Any help is more than appreciated and the best way to contribute is submitting a pull request. Bug fixes are always welcome. If you wish to submit a new feature, please create an issue and discuss it beforehand.")]),t._v(" "),o("p",[t._v("If you found a bug and want to report it, please test it first in a web-browser that is used by default for your operating system to see if the problem is with your code, rather than pywebview. Do not forget to specify on which platform and pywebview version it occurs.")]),t._v(" "),o("p",[t._v("To support pywebview financially, consider becoming a patron of the project. Pywebview has no corporate backing and financial help is welcomed to keep the project alive.")]),t._v(" "),o("div",{staticClass:"center spc-l spc-vertical"},[o("a",{attrs:{href:"https://www.patreon.com/bePatron?u=13226105","data-patreon-widget-type":"become-patron-button"}},[o("img",{attrs:{src:"https://c5.patreon.com/external/logo/become_a_patron_button.png",alt:"Become a Patron!"}})])]),t._v(" "),o("div",{staticClass:"center spc-l spc-vertical"},[o("a",{attrs:{href:"https://opencollective.com/pywebview/donate",target:"_blank"}},[o("img",{attrs:{src:"https://opencollective.com/pywebview/donate/button@2x.png?color=blue",width:"300"}})])]),t._v(" "),o("p",[t._v("For other ways to donate refer to the "),o("RouterLink",{attrs:{to:"/contributing/donating.html"}},[t._v("donation")]),t._v(" page.")],1)])}),[],!1,null,null,null);e.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/12.0a86c191.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[12],{412:function(e,t,r){"use strict";r.r(t);var s=r(58),i=Object(s.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"bug-reporting"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#bug-reporting"}},[e._v("#")]),e._v(" Bug reporting")]),e._v(" "),r("p",[e._v("If you think you found a bug, verify following steps first")]),e._v(" "),r("ol",[r("li",[e._v("Does the bug occur in a default browser? If so, the problem is with your code, not pywebview")]),e._v(" "),r("li",[e._v("Are you using the latest master? Bug fixes are merged into the master and it may take a while until a new release is deployed to Pypi.")]),e._v(" "),r("li",[e._v("Has it been "),r("a",{attrs:{href:"https://github.com/r0x0r/pywebview/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("reported"),r("OutboundLink")],1),e._v(" already?")])]),e._v(" "),r("p",[e._v("If you verified all the three points and are sure that the issue is caused by pywebview, feel free to submit a new issue. Please remember to specify under which operating system the bug occurs, as well as with other relevant information. In case of Linux, specify a distro you are using.")])])}),[],!1,null,null,null);t.default=i.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/14.2a7dc35b.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[14],{416:function(t,e,a){"use strict";a.r(e);var n=a(58),o=Object(n.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[e("h1",{attrs:{id:"documentation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#documentation"}},[this._v("#")]),this._v(" Documentation")]),this._v(" "),e("p",[this._v("One way to contribute is to improve documentation on this side. Each page has a 'Help us improve this page' link at the bottom of the page. By clicking the link you can create a pull request with your changes. You need a Github account to edit pages.")])])}),[],!1,null,null,null);e.default=o.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/15.90c9f36a.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[15],{417:function(t,e,a){"use strict";a.r(e);var r=a(58),n=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"donating"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#donating"}},[t._v("#")]),t._v(" Donating")]),t._v(" "),a("h2",{attrs:{id:"recurrring-pledge"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recurrring-pledge"}},[t._v("#")]),t._v(" Recurrring pledge")]),t._v(" "),a("p",[t._v("Recurring pledges come perks, like getting email support or featuring your name or logo in the project repository")]),t._v(" "),a("div",{staticClass:"center spc-l spc-vertical"},[a("a",{attrs:{href:"https://www.patreon.com/bePatron?u=13226105","data-patreon-widget-type":"become-patron-button"}},[a("img",{attrs:{src:"https://c5.patreon.com/external/logo/become_a_patron_button.png",alt:"Become a Patron!"}})])]),t._v(" "),a("div",{staticClass:"center spc-l spc-vertical"},[a("a",{attrs:{href:"https://opencollective.com/pywebview/donate",target:"_blank"}},[a("img",{attrs:{src:"https://opencollective.com/pywebview/donate/button@2x.png?color=blue",width:"300"}})])]),t._v(" "),a("h2",{attrs:{id:"one-time-donations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#one-time-donations"}},[t._v("#")]),t._v(" One-time donations")]),t._v(" "),a("p",[t._v("We accept donations via Paypal")]),t._v(" "),a("div",{staticClass:"center spc-l spc-vertical"},[a("a",{attrs:{href:"http://bit.ly/2eg2Z5P",target:"_blank"}},[a("img",{attrs:{src:"/paypal.png"}})])])])}),[],!1,null,null,null);e.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/19.b31e62b7.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[19],{418:function(t,a,s){"use strict";s.r(a);var n=s(58),e=Object(n.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"quit-confirmation-dialog"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quit-confirmation-dialog"}},[t._v("#")]),t._v(" Quit confirmation dialog")]),t._v(" "),s("div",{staticClass:"language-python extra-class"},[s("pre",{pre:!0,attrs:{class:"language-python"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),s("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\nThis example demonstrates a webview window with a quit confirmation dialog.\n"""')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create a standard webview window")]),t._v("\n webview"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Confirm Close Example'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n confirm_close"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/22.2a3916f2.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[22],{421:function(t,s,a){"use strict";a.r(s);var n=a(58),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"css-load"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#css-load"}},[t._v("#")]),t._v(" CSS load")]),t._v(" "),a("p",[t._v("Change window background color by loading CSS")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("load_css")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("load_css"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'body { background: red !important; }'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n window "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Load CSS Example'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("load_css"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/23.712fbf84.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[23],{423:function(t,s,n){"use strict";n.r(s);var a=n(58),e=Object(a.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"debugging"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debugging"}},[t._v("#")]),t._v(" Debugging")]),t._v(" "),n("p",[t._v("To open up debugging console, right click on an element and select Inspect.")]),t._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Debug window'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("debug"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/27.e2a4e1bf.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{427:function(t,s,a){"use strict";a.r(s);var n=a(58),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"frameless-window"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#frameless-window"}},[t._v("#")]),t._v(" Frameless window")]),t._v(" "),a("p",[t._v("Create a frameless window. The window can be moved around by dragging any point.")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Frameless window'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'http://pywebview.flowrl.com/hello'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n frameless"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/28.abcc819c.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[28],{424:function(t,s,n){"use strict";n.r(s);var a=n(58),e=Object(a.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"fullscreen-window"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#fullscreen-window"}},[t._v("#")]),t._v(" Fullscreen window")]),t._v(" "),n("p",[t._v("Create a fullscreen window.")]),t._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Full-screen window'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n fullscreen"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("True")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/29.c379d080.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[29],{436:function(t,n,s){"use strict";s.r(n);var a=s(58),e=Object(a.a)({},(function(){var t=this,n=t.$createElement,s=t._self._c||n;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"get-current-url"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-current-url"}},[t._v("#")]),t._v(" Get current URL")]),t._v(" "),s("p",[t._v("Print current URL after page is loaded.")]),t._v(" "),s("div",{staticClass:"language-python extra-class"},[s("pre",{pre:!0,attrs:{class:"language-python"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_current_url")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("window"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("print")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("window"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get_current_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n window "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" webview"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Get current URL'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("get_current_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" window"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);n.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/3.749f6582.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{373:function(t,e,n){},401:function(t,e,n){"use strict";n(373)},466:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(401),n(58)),p=Object(r.a)(i,void 0,void 0,!1,null,"15b7b770",null);e.default=p.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/36.d53c471f.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[36],{434:function(t,n,a){"use strict";a.r(n);var e=a(58),s=Object(e.a)({},(function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"link-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#link-types"}},[t._v("#")]),t._v(" Link types")]),t._v(" "),a("p",[t._v("Demonstrate a difference between different link types")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\nhtml "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v("\"\"\"\n \n
\n\n \n \n\"\"\"")]),t._v("\n\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n window "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Link types'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" html"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("html"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);n.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/4.f2c64e71.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{374:function(t,e,a){},402:function(t,e,a){"use strict";a(374)},406:function(t,e,a){"use strict";a.r(e);var n={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted:function(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},i=(a(402),a(58)),s=Object(i.a)(n,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"759a7d02",null);e.default=s.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/40.53182a9c.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[40],{438:function(t,s,n){"use strict";n.r(s);var a=n(58),e=Object(a.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"minimum-window-size"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#minimum-window-size"}},[t._v("#")]),t._v(" Minimum window size")]),t._v(" "),n("p",[t._v("Set minimum window dimensions.")]),t._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create a resizable webview window with minimum size constraints")]),t._v("\n webview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Minimum window size'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n min_size"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("400")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/46.d1621897.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[46],{443:function(t,s,a){"use strict";a.r(s);var n=a(58),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"open-url"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#open-url"}},[t._v("#")]),t._v(" Open URL")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create a standard webview window")]),t._v("\n window "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Simple browser'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/5.2a771d7d.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{375:function(e,t,a){},403:function(e,t,a){"use strict";a(375)},407:function(e,t,a){"use strict";a.r(t);a(84),a(39),a(7),a(116),a(117);var o={name:"CodeGroup",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.activateCodeTab(e)}},mounted:function(){this.loadTabs()},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e},loadTabs:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,a){return""===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=a),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab:function(e){this.codeTabs.forEach((function(e){e.elm&&e.elm.classList.remove("theme-code-block__active")})),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},n=(a(403),a(58)),c=Object(n.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ClientOnly",[a("div",{staticClass:"theme-code-group"},[a("div",{staticClass:"theme-code-group__nav"},[a("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(t,o){return a("li",{key:t.title,staticClass:"theme-code-group__li"},[a("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(t.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?a("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"deefee04",null);t.default=c.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/51.8a918a6c.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[51],{448:function(t,s,a){"use strict";a.r(s);var n=a(58),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"change-user-agent-string"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#change-user-agent-string"}},[t._v("#")]),t._v(" Change user agent string")]),t._v(" "),a("p",[t._v("Change the user-agent of a window. EdgeHTML is not supported.")]),t._v(" "),a("div",{staticClass:"language-python extra-class"},[a("pre",{pre:!0,attrs:{class:"language-python"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" webview\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'__main__'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("create_window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'User Agent Test'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://pywebview.flowrl.com/hello'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n webview"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("start"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("user_agent"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Custom user agent'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/54.2b15d6fb.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[54],{454:function(e,t,o){"use strict";o.r(t);var n=o(58),r=Object(n.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"about"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#about"}},[e._v("#")]),e._v(" About")]),e._v(" "),o("p",[o("em",[e._v("pywebview")]),e._v(" is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its own native GUI window. You may think of as Electron for Python (minus huge executable sizes). It gives you power of web technologies in your desktop application, hiding the fact that GUI is browser based. You can use pywebview either with a lightweight web framework like "),o("a",{attrs:{href:"http://flask.pocoo.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Flask"),o("OutboundLink")],1),e._v(" or "),o("a",{attrs:{href:"http://bottlepy.org/docs/dev/index.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bottle"),o("OutboundLink")],1),e._v(" or on its own with a two way bridge between Python and DOM.")]),e._v(" "),o("p",[o("em",[e._v("pywebview")]),e._v(" uses native GUI for creating a web component window: WinForms on Windows, Cocoa on macOS and QT or GTK on Linux. If you choose to freeze your application, pywebview does not bundle a heavy GUI toolkit or web renderer with it keeping the executable size small.")]),e._v(" "),o("p",[o("em",[e._v("pywebview")]),e._v(" is a BSD licensed open source project. It is an independent project with no corporate backing. If you find "),o("em",[e._v("pywebview")]),e._v(" useful, consider supporting it. More donation options are outlined on the "),o("RouterLink",{attrs:{to:"/contributing/donating.html"}},[e._v("Donating")]),e._v(" page.")],1),e._v(" "),o("div",{staticClass:"spc-l spc-bottom center"},[o("a",{attrs:{href:"https://www.patreon.com/bePatron?u=13226105","data-patreon-widget-type":"become-patron-button"}},[o("img",{attrs:{src:"https://c5.patreon.com/external/logo/become_a_patron_button.png",alt:"Become a Patron!"}})])]),e._v(" "),o("div",{staticClass:"center spc-l spc-vertical"},[o("a",{attrs:{href:"https://opencollective.com/pywebview/donate",target:"_blank"}},[o("img",{attrs:{src:"https://opencollective.com/pywebview/donate/button@2x.png?color=blue",width:"300"}})])]),e._v(" "),o("p",[o("em",[e._v("pywebview")]),e._v(" is created by "),o("a",{attrs:{href:"https://github.com/r0x0r/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Roman Sirokov"),o("OutboundLink")],1),e._v(".")])])}),[],!1,null,null,null);t.default=r.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/57.61e9e46c.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[57],{458:function(e,t,n){"use strict";n.r(t);var a=n(58),o=Object(a.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"debugging"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debugging"}},[e._v("#")]),e._v(" Debugging")]),e._v(" "),n("p",[e._v("To debug Javascript, set the "),n("code",[e._v("debug")]),e._v(" parameter of "),n("code",[e._v("start")]),e._v(" to "),n("code",[e._v("True")])]),e._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("import")]),e._v(" webview\n\nwebview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("create_window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[e._v("'https://pywebview.flowrl.com/hello'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\nwebview"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("start"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("debug"),n("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("True")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),n("p",[e._v("This will enable web inspector on macOS, GTK and QT (QTWebEngine only). To open the web inspector, right click on the page and select Inspect.")]),e._v(" "),n("p",[e._v("To debug EdgeHTML, you need to install "),n("a",{attrs:{href:"https://www.microsoft.com/en-us/p/microsoft-edge-devtools-preview/9mzbfrmz0mnj",target:"_blank",rel:"noopener noreferrer"}},[e._v("Microsoft Edge DevTools Preview"),n("OutboundLink")],1),e._v(". Launch the application and select your application from the list of running WebViews. The "),n("code",[e._v("debug")]),e._v(" flag also routes "),n("code",[e._v("console.logs")]),e._v(" to the Python console.")]),e._v(" "),n("p",[e._v("There is no way to attach an external debugger to MSHTML. The "),n("code",[e._v("debug")]),e._v(" flag enables Javascript error reporting and right-click context menu on Windows.")])])}),[],!1,null,null,null);t.default=o.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/58.cc70e253.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[58],{460:function(e,r,t){"use strict";t.r(r);var o=t(58),n=Object(o.a)({},(function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"freezing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#freezing"}},[e._v("#")]),e._v(" Freezing")]),e._v(" "),t("h2",{attrs:{id:"macos"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#macos"}},[e._v("#")]),e._v(" macOS")]),e._v(" "),t("p",[e._v("Use "),t("a",{attrs:{href:"https://py2app.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer"}},[e._v("py2app"),t("OutboundLink")],1),e._v(". For a reference setup.py for py2app, look "),t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/blob/master/examples/py2app_setup.py",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"windows"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#windows"}},[e._v("#")]),e._v(" Windows")]),e._v(" "),t("p",[e._v("Use "),t("a",{attrs:{href:"https://www.pyinstaller.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("pyinstaller"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("If you are using "),t("em",[e._v("PyInstaller>=3.6")]),e._v(", it should work out of the box as there is hook that takes care of the bundling of necessary dlls. Therefore, this version of PyInstaller is the recommended one.")]),e._v(" "),t("p",[e._v("Should you need to use prior versions of PyInstaller (<=3.5), you will need to bundle the dlls yourself. Either "),t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/blob/master/webview/lib/WebBrowserInterop.x86.dll",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebBrowserInterop.x86.dll"),t("OutboundLink")],1),e._v(" or "),t("a",{attrs:{href:"https://github.com/r0x0r/pywebview/blob/master/webview/lib/WebBrowserInterop.x64.dll",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebBrowserInterop.x64.dll"),t("OutboundLink")],1),e._v(" depending on whether you build against 32-bit or 64-bit Python.\nThe DLLs bundled with "),t("em",[e._v("pywebview")]),e._v(" and are located in the "),t("code",[e._v("site-packages/webview/lib")]),e._v(" directory.")]),e._v(" "),t("h2",{attrs:{id:"linux"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#linux"}},[e._v("#")]),e._v(" Linux")]),e._v(" "),t("p",[e._v("Use "),t("a",{attrs:{href:"https://www.pyinstaller.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("pyinstaller"),t("OutboundLink")],1),e._v(".")])])}),[],!1,null,null,null);r.default=n.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/62.bf000bcc.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[62],{464:function(e,t,r){"use strict";r.r(t);var o=r(58),a=Object(o.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"security"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#security"}},[e._v("#")]),e._v(" Security")]),e._v(" "),r("p",[e._v("When using a local web server, you must protect your API from unauthorized access. "),r("a",{attrs:{href:"https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)",target:"_blank",rel:"noopener noreferrer"}},[e._v("CSRF attacks"),r("OutboundLink")],1),e._v(" can be a major problem if API is not protected in an adequate matter. "),r("em",[e._v("pywebview")]),e._v(" generates a session-unique token that is exposed both to Python "),r("code",[e._v("webview.token")]),e._v(" and DOM "),r("code",[e._v("window.pywebview.token")]),e._v(". See "),r("a",{attrs:{href:"https://github.com/r0x0r/pywebview/tree/master/examples/flask_app",target:"_blank",rel:"noopener noreferrer"}},[e._v("Flask app"),r("OutboundLink")],1),e._v(" for an example.")]),e._v(" "),r("p",[e._v("For building a custom solution refer to "),r("a",{attrs:{href:"https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet",target:"_blank",rel:"noopener noreferrer"}},[e._v("this document"),r("OutboundLink")],1),e._v(" for API securing approaches. A library like "),r("a",{attrs:{href:"https://flask-seasurf.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer"}},[e._v("flask-seasurf"),r("OutboundLink")],1),e._v(" alongside Flask can be used too.")])])}),[],!1,null,null,null);t.default=a.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/64.2b6fe843.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[64],{465:function(e,t,n){"use strict";n.r(t);var a=n(58),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"virtual-environment"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#virtual-environment"}},[e._v("#")]),e._v(" Virtual environment")]),e._v(" "),n("p",[e._v("If you create a virtual environment using the built-in Python on macOS, a pywebview window will have issues with keyboard focus and Cmd+Tab. The issue can be avoided by using other Python installation as described "),n("a",{attrs:{href:"https://virtualenv.pypa.io/en/stable/userguide/#using-virtualenv-without-bin-python",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),n("OutboundLink")],1),e._v(". For example to use Python 3 via "),n("a",{attrs:{href:"https://brew.sh",target:"_blank",rel:"noopener noreferrer"}},[e._v("Homebrew"),n("OutboundLink")],1),e._v(".")]),e._v(" "),n("div",{staticClass:"language-bash extra-class"},[n("pre",{pre:!0,attrs:{class:"language-bash"}},[n("code",[e._v("brew "),n("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" python3\nvirtualenv pywebview_env -p python3\n")])])])])}),[],!1,null,null,null);t.default=r.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/assets/js/7.779cbcff.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{405:function(t,e,s){"use strict";s.r(e);var n=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],o={methods:{getMsg:function(){return n[Math.floor(Math.random()*n.length)]}}},i=s(58),h=Object(i.a)(o,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("div",{staticClass:"theme-default-content"},[e("h1",[this._v("404")]),this._v(" "),e("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),e("RouterLink",{attrs:{to:"/"}},[this._v("\n Take me home.\n ")])],1)])}),[],!1,null,null,null);e.default=h.exports}}]);
2 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/logo-no-text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/logo-no-text.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/logo.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/paypal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/paypal.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/screenshots/todos-linux.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/screenshots/todos-linux.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/screenshots/todos-macos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/screenshots/todos-macos.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/screenshots/todos-windows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/screenshots/todos-windows.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/3.7/windows31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r0x0r/pywebview/eccca484120ad004907f541c5b40e9f5903d2071/docs/.vuepress/public/3.7/windows31.png
--------------------------------------------------------------------------------
/docs/.vuepress/public/download/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Pywebview download test
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 |
23 | For other ways to donate refer to the [donation](/contributing/donating.html) page.
24 |
--------------------------------------------------------------------------------
/docs/contributing/bug_reporting.md:
--------------------------------------------------------------------------------
1 | # Bug reporting
2 |
3 | If you think you found a bug, verify following steps first
4 |
5 | 1. Does the bug occur in a default browser? If so, the problem is with your code, not pywebview
6 | 2. Are you using the latest master? Bug fixes are merged into the master and it may take a while until a new release is deployed to Pypi.
7 | 3. Has it been [reported](https://github.com/r0x0r/pywebview/issues) already?
8 |
9 | If you verified all the three points and are sure that the issue is caused by pywebview, feel free to submit a new issue. Please remember to specify under which operating system the bug occurs, as well as with other relevant information. In case of Linux, specify a distro you are using.
10 |
--------------------------------------------------------------------------------
/docs/contributing/documentation.md:
--------------------------------------------------------------------------------
1 | # Documentation
2 |
3 | One way to contribute is to improve documentation on this side. Each page has a 'Help us improve this page' link at the bottom of the page. By clicking the link you can create a pull request with your changes. You need a Github account to edit pages.
4 |
--------------------------------------------------------------------------------
/docs/contributing/donating.md:
--------------------------------------------------------------------------------
1 | # Donating
2 |
3 |
4 | ## Recurrring pledge
5 |
6 | Recurring pledges come perks, like getting email support or featuring your name or logo in the project repository
7 |
8 |
30 |
--------------------------------------------------------------------------------
/docs/examples/README.md:
--------------------------------------------------------------------------------
1 | # Examples
2 |
3 | You can find examples demonstrating features of _pywebview_ in the sidebar.
4 |
5 | Below there are a couple of non-trivial examples that demonstrate an application architecture.
6 |
7 | ## React Boilerplate
8 |
9 | [React boilerplate with parcel-bundler](https://github.com/r0x0r/pywebview-react-boilerplate). A complete React-based boilerplate with installation, usage and building taken care of out of the box.
10 |
11 | [React boilerplate with create-react-app](https://github.com/dzc0d3r/pywebview-react-boilerplate/). A complete React-based boilerplate with installation, usage and building taken care of out of the box.
12 |
13 |
14 | ## Serverless application
15 |
16 | [Serverless application](https://github.com/r0x0r/pywebview/tree/docs/examples/todos)
17 |
18 | A simple todo application that uses serverless architecture. Communication between frontend and backend is provided by built-in API.
19 |
20 |
21 |
22 |
23 |
Windows
24 |
25 |
26 |
27 |
macOS
28 |
29 |
30 |
31 |
Linux
32 |
33 |
34 |
35 | ## HTTP server application
36 |
37 | [Flask-based application](https://github.com/r0x0r/pywebview/tree/docs/examples/flask_app)
38 |
39 | In this example communication between frontend and backend is facilitated by a Flask server.
40 |
--------------------------------------------------------------------------------
/docs/guide/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | _pywebview_ is a lightweight native webview wrapper that allows to display HTML content in its own native GUI window. It gives you power of web technologies in your desktop application, hiding the fact that GUI is browser based. _pywebview_ ships with a built-in HTTP server, DOM support in Python and window management functionality.
4 |
5 | _pywebview_ is available for Windows, macOS, Linux (GTK or QT) and Android. It uses native GUI for creating a web component window: WinForms on Windows, Cocoa on macOS and QT or GTK on Linux. If you choose to freeze your application, _pywebview_ does not bundle a heavy GUI toolkit or web renderer with it keeping the executable size small.
6 |
7 | _pywebview_ provides advanced features like window manipulation functionality, event system, built-in HTTP server, native GUI elements like application menu and various dialogs, two way communication between Javascript ↔ Python and DOM support.
8 |
9 | _pywebview_ is created by [Roman Sirokov](https://github.com/r0x0r/).
10 |
11 | ## Install
12 |
13 | Generally, you should be able to install _pywebview_ with
14 |
15 | ``` bash
16 | pip install pywebview
17 | ```
18 |
19 | Although on some Linux platforms you may need to install additional libraries. Refer to the [installation](/guide/installation.html) page for details.
20 |
21 | ## Develop
22 |
23 | Read the basic concepts in [Usage](/guide/usage), dive into [application architecture](/guide/architecture). Explore [API](/guide/api) and check various [examples](/examples)
24 |
25 | ## Contribute
26 |
27 | Checkout out [contributing guidelines](/contributing/)
28 |
29 | ## Support the project
30 |
31 | If you find _pywebview_ useful, please support it.
32 |
33 | ::: center
34 | [](https://github.com/sponsors/r0x0r)
35 |
36 | [](https://www.patreon.com/bePatron?u=13226105)
37 |
38 | [](https://opencollective.com/pywebview/donate)
39 | :::
--------------------------------------------------------------------------------
/docs/guide/architecture.md:
--------------------------------------------------------------------------------
1 | # Application architecture
2 |
3 | There are several way to build your application using _pywebview_:
4 |
5 | ## Pure web server
6 |
7 | - The most simple case is pointing to a url. This requires a running web server either remotely or locally
8 |
9 | ``` python
10 | webview.create_window('Simple browser', 'https://pywebview.flowrl.com')
11 | webview.start()
12 | ```
13 |
14 | If you point to a local web server, you can start an external HTTP server in a background thread manually and or giving a WSGIRef server instance to the url parameter.
15 |
16 | ``` python
17 | server = Flask(__name__, static_folder='.', template_folder='.')
18 | webview.create_window('My first pywebview application', server)
19 | webview.start()
20 | ```
21 |
22 | See a complete example [Flask-based application](https://github.com/r0x0r/pywebview/tree/master/examples/flask_app)
23 |
24 | When using a local web server, you should protect your API calls against CSRF attacks. See [security](/guide/security.html) for more information.
25 |
26 | While the `file://` protocol is possible, its use is discouraged as it comes with a number of inherit limitations and is not well supported.
27 |
28 | ## JS API with internal HTTP server
29 |
30 | Another approach is using JS API bridge and serving static content with a built-in HTTP server. JS API bridge allows communication between Python and Javascript domains without a web server. Thje bridge can be created either with `create_window(..., js_api=Api())` or `window.expose` function. To serve static contents, set entrypoint url to a local relative path. This will start a built-in HTTP server automatically. For more details on communication between Python and Javascript refer to [interdomain communication](/guide/interdomain.html). See an example [serverless application](https://github.com/r0x0r/pywebview/tree/master/examples/todos) for a complete implementation.
31 |
32 | ## Serverless
33 |
34 | - Finally you can do without a web server altogther by loading HTML using `webview.create_window(...html='')` or `window.load_html`. This approach has got limitations though, as file system does not exist in the context of the loaded page. Images and other assets can be loaded only inline using Base64.
35 |
--------------------------------------------------------------------------------
/docs/guide/debugging.md:
--------------------------------------------------------------------------------
1 | # Debugging
2 |
3 | To debug Javascript, set `webview.start(debug=True)`
4 |
5 | ``` python
6 | import webview
7 |
8 | webview.create_window('Woah dude!', 'https://pywebview.flowrl.com/hello')
9 | webview.start(debug=True)
10 | ```
11 |
12 | This will enable web inspector on macOS, GTK and QT (QTWebEngine only). To open the web inspector on macOS, right click on the page and select Inspect. To disable auto-opening of DevTools, set `webview.settings['OPEN_DEVTOOLS_IN_DEBUG'] = False` before invoking `webview.start()`.
13 |
14 | Debugging Python code on Android is not possible apart from printing message to `logcat`. Use `adb -s logcat | grep python` for displaying log messages related to Python. Frontend code can be debugged with WebView remote debugging. Refer to [this guide](https://developer.chrome.com/docs/devtools/remote-debugging/webviews/) for details.
15 |
16 | Remote debugging is supported with the `edgechromium` renderer. To take remote debugging into use set `webview.settings['REMOTE_DEBUGGING_PORT']` to the port number you wish to run a debugger on.
17 |
18 | There is no way to attach an external debugger to MSHTML. The `debug` flag enables Javascript error reporting and right-click context menu.
19 |
--------------------------------------------------------------------------------
/docs/guide/faq.md:
--------------------------------------------------------------------------------
1 | # FAQ
2 |
3 | ## How do I set an application icon?
4 |
5 | For macOS, Windows, and Android, the application icon is set via a bundler and embedded in the resulting executable. For GTK and QT, you can set the application icon using `webview.start(icon=icon_path)`, but you might need some additional adjustments to get your icon visible depending on the window manager you use.
6 |
7 | ## Why does _pywebview_ have to run on a main thread?
8 |
9 | This is dictated by underlying GUI libraries _pywebview_ is based on. GUI loop is expected to run on a main thread. While some libraries allow the GUI to be run in a sub-thread, Cocoa has a strict requirement regarding the main thread. If you need your logic to run in a main thread, use the `multiprocessing` module.
10 |
11 | ## webview has no attribute create_window
12 |
13 | You probably have a file named `webview.py` in the current directory. Renaming it to something else should fix the problem.
14 |
15 | ## What renderer is used?
16 |
17 | Set `PYWEBVIEW_LOG=debug` environment variable before running your programme. It will display used renderer in the first line of the program output. See available renderers [here](/guide/renderer)
18 |
19 | ## Terminal window receives key events on macOS
20 |
21 | If you create a virtual environment using the built-in Python on macOS, a pywebview window will have issues with keyboard focus and Cmd+Tab. The issue can be avoided by using other Python installation. For example to use Python 3 via [Homebrew](https://brew.sh).
22 |
23 | ``` bash
24 | brew install python3
25 | virtualenv pywebview_env -p python3
26 | ```
27 |
28 | ## Frozen executable is too big
29 |
30 | Big executable size is caused by packager picking up unnecessary dependencies. For example if you have `PyQt` installed but use Winforms on Windows, Pyinstaller will bundle both frameworks. To avoid this in Pyinstaller, use `--exclude-module` option to explicitly omit the module.
31 |
--------------------------------------------------------------------------------
/docs/guide/freezing.md:
--------------------------------------------------------------------------------
1 | # Freezing
2 |
3 | ## Android
4 |
5 | pywebview is designed to be built with [buildozer](https://buildozer.readthedocs.io/en/latest/). You need to include following lines in your `buildozer.spec` to bundle pywebview correctly
6 |
7 | ``` ini
8 | requirements = python3,kivy,pywebview
9 | android.add_jars =
10 | ```
11 |
12 | `pywebview-android.jar` is shipped with `pywebview` and can be found under `site-packages/pywebview/lib`. To get its full path type
13 |
14 | ``` python
15 | from webview import util
16 | print(util.android_jar_path())
17 | ```
18 |
19 | You can see a sample `bulldozer.spec` [here](https://github.com/r0x0r/pywebview/blob/master/examples/todos/bulldozer.spec)
20 |
21 | ## macOS
22 |
23 | Use [py2app](https://py2app.readthedocs.io/en/latest/). For a reference setup.py for py2app, look [here](https://github.com/r0x0r/pywebview/blob/master/examples/py2app_setup.py).
24 |
25 | ## Windows / Linux
26 |
27 | Use [pyinstaller](https://www.pyinstaller.org/). Pyinstaller picks all the dependencies found in `pywebview`, even if you don't use them. So for example if you have `PyQt` installed, but use `EdgeChromium` renderer on Windows, pyinstaller will bundle `PyQT` all the same. To prevent that you might want to add unwanted dependencies to `excludes` in your spec file.
28 |
29 | [nuitka](http://nuitka.net/) can be used for freezing as well. You may want to use `--nofollow-import-to` to exclude unwanted dependencies.
30 |
--------------------------------------------------------------------------------
/docs/guide/interdomain.md:
--------------------------------------------------------------------------------
1 | # Javascript–Python bridge
2 |
3 | _pywebview_ offers two-way communication between Javascript and Python, enabling interaction between the two languages without a HTTP server.
4 |
5 | ## Run Javascript from Python
6 |
7 | `window.evaluate_js(code, callback=None)` allows you to execute arbitrary Javascript code with a last value returned synchronously. If callback function is supplied, then promises are resolved and the callback function is called with the result as a parameter. Javascript types are converted to Python types, eg. JS objects to dicts, arrays to lists, undefined to None. If executed Javascript code results in an error, the error is rethrown as a `webview.util.JavascriptException` in Python. `evaluate_js` wraps Javascript code in a helper wrapper and executes it using `eval`.
8 |
9 | [See example](/examples/evaluate_js.html)
10 |
11 | `window.run_js(code)` executes Javascript code as is without any wrapper code. `run_js` does not return a result or handle exceptions. This can be useful in scenarios, where you need to execute Javascript code with the `unsafe-eval` CSP policy set.
12 |
13 | ## Run Python from Javascript
14 |
15 | Executing Python functions from Javascript can be done with two different mechanisms.
16 |
17 | - by exposing an instance of a Python class to the `js_api` parameter of `create_window`. All the callable methods of the class will be exposed to the JS domain as `pywebview.api.method_name` with correct parameter signatures. Method name must not start with an underscore. Nested classes are allowed and are converted into a nested objects in Javascript. Class attributes starting with an underscore are not exposed. See an [example](/examples/js_api.html).
18 |
19 | - by passing your function(s) to window object's `expose(func)`. This will expose a function or functions to the JS domain as `pywebview.api.func_name`. Unlike JS API, `expose` allows to expose functions also at the runtime. If there is a name clash between JS API and exposed functions, the latter takes precedence. See an [example](/examples/expose.html).
20 |
21 | Exposed function returns a promise that is resolved to its result value. Exceptions are rejected and encapsulated inside a Javascript `Error` object. Stacktrace is available via `error.stack`. Exposed functions are executed in separate threads and are not thread-safe.
22 |
23 | `window.pywebview.api` is not guaranteed to be available on the `window.onload` event. Subscribe to the `window.pywebviewready` event instead to make sure that `window.pywebview.api` is ready.
24 |
25 | [See example](/examples/js_api.html).
26 |
--------------------------------------------------------------------------------
/docs/guide/security.md:
--------------------------------------------------------------------------------
1 | # Security
2 |
3 | It is advisable to enable SSL for local HTTP server. To accomplish this, simply start the application with the `ssl` paramater set to True `webview.start(ssl=True)`. You need to have `cryptography` pip dependency installed in order to use `ssl`. It is not installed by default.
4 |
5 | If you employ a REST API, [CSRF attacks](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)) can be a major concern. _pywebview_ mitigates this risk by generating a session-unique token that is accessible in Python as `webview.token` and in JavaScript as `window.pywebview.token`. For more information on securing APIs, refer to the [CSRF Prevention Cheat Sheet](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_\(CSRF\)_Prevention_Cheat_Sheet). You can also see a practical example in the [Flask app](https://github.com/r0x0r/pywebview/tree/master/examples/flask_app).
6 |
--------------------------------------------------------------------------------
/docs/guide/web_engine.md:
--------------------------------------------------------------------------------
1 | # Web engine
2 |
3 | The following renderers are used on each platform
4 |
5 | | Platform | Code | Renderer | Provider | Browser compatibility |
6 | |----------|--------------|----------|---------------------------------------------------|-----------------------|
7 | | Android | | WebKit | | Ever-green Chromium |
8 | | GTK | gtk | WebKit | WebKit2 (minimum version >2.2) | |
9 | | macOS | | WebKit | WebKit.WKWebView (bundled with OS) | |
10 | | QT | qt | WebKit | QtWebEngine / QtWebKit | |
11 | | Windows | edgechromium | Chromium | > .NET Framework 4.6.2 and Edge Runtime installed | Ever-green Chromium |
12 | | Windows | cef | CEF | CEF Python | Chrome 66 |
13 | | Windows | mshtml | MSHTML | DEPRECATED Internet Explorer MSHTML | IE11 (Windows 10/8/7) |
14 |
15 | On Windows renderer is chosen in the following order: `edgechromium`, `mshtml`. `mshtml` is the only renderer that is guaranteed to be available on any system. Edge Runtime must be installed in order to use Edge Chromium on Windows. You can download it from [here](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Distribution guidelines are found [here](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution).
16 |
17 | To change a default renderer set either `PYWEBVIEW_GUI` environment variable or pass the rendered value to `webview.start(gui=code)` function parameter. Check for available values in the Code column from the table above.
18 |
19 | For example to use CEF on Windows
20 |
21 | ``` bash
22 | export PYWEBVIEW_GUI=cef
23 | ```
24 |
25 | or
26 |
27 | ``` python
28 | import webview
29 | webview.start(gui='cef')
30 | ```
31 |
32 | If you wish to pass custom settings to CEF, refer to [this example](/examples/cef.html)
33 |
34 | To force QT on Linux systems
35 |
36 | ``` bash
37 | export PYWEBVIEW_GUI=qt
38 | ```
39 |
40 | or
41 |
42 | ``` python
43 | import webview
44 | webview.start(gui='qt')
45 | ```
46 |
47 | ## Known issues and limitations
48 |
49 | ## QtWebKit
50 |
51 | * Debugging is not supported
52 |
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "docs:dev": "vuepress dev --debug .",
4 | "docs:build": "NODE_ENV=production vuepress build . && cp _redirects .vuepress/dist"
5 | },
6 | "devDependencies": {
7 | "@vuepress/bundler-vite": "^2.0.0-rc.19",
8 | "@vuepress/plugin-medium-zoom": "1.9.10",
9 | "directory-tree": "^3.5.1",
10 | "sass-embedded": "^1.83.0",
11 | "vuepress": "2.0.0-rc.19",
12 | "vuepress-theme-hope": "^2.0.0-rc.66"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/assets/cookies.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
JS API function Expose'
31 | )
32 | window.expose(lol, wtf) # expose functions beforehand
33 |
34 | webview.start(expose, window)
35 |
--------------------------------------------------------------------------------
/examples/flask_app/README:
--------------------------------------------------------------------------------
1 | # Flask app
2 |
3 | This is a sample skeleton of an application using pywebview and Flask. The directory structure as well as some basic boilerplate code is provided. The application entry point is src/backend/main.py.
4 |
--------------------------------------------------------------------------------
/examples/flask_app/requirements.txt:
--------------------------------------------------------------------------------
1 | flask
2 | pywebview
3 |
--------------------------------------------------------------------------------
/examples/flask_app/src/backend/app.py:
--------------------------------------------------------------------------------
1 | """
2 | Application stub
3 | """
4 |
5 |
6 | def initialize():
7 | # perform heavy stuff here
8 | return True
9 |
10 |
11 | def do_stuff():
12 | # do whatever you need to do
13 | response = 'This is response from Python backend'
14 | return response
15 |
--------------------------------------------------------------------------------
/examples/flask_app/src/backend/main.py:
--------------------------------------------------------------------------------
1 | import logging
2 | from contextlib import redirect_stdout
3 | from io import StringIO
4 |
5 | from server import server
6 |
7 | import webview
8 |
9 | logger = logging.getLogger(__name__)
10 |
11 |
12 | if __name__ == '__main__':
13 | stream = StringIO()
14 | with redirect_stdout(stream):
15 | window = webview.create_window('My first pywebview application', server)
16 | webview.start()
17 |
--------------------------------------------------------------------------------
/examples/flask_app/src/frontend/README:
--------------------------------------------------------------------------------
1 | Put here your GUI code here created with your favorite front-end technologies. The backend is configured to look for
2 | frontend code in the `gui` directory of the root directory. So the code put here shall be configured to produce output
3 | to the `gui` directory (e.g. using webpack, gulp or equivalent). Or forget all this and just put your frontend code
4 | directly in the `gui` directory.
5 |
--------------------------------------------------------------------------------
/examples/focus.py:
--------------------------------------------------------------------------------
1 | import webview
2 |
3 | """
4 | Create a non-focusable window that can be useful for onscreen floating tools.
5 | """
6 |
7 | if __name__ == '__main__':
8 | webview.create_window('Nonfocusable window', html='
You shouldnt be able to type into this window...
...but still you can click elements in this window...
', focus=False)
9 | webview.start()
10 |
--------------------------------------------------------------------------------
/examples/frameless.py:
--------------------------------------------------------------------------------
1 | """Create a frameless window. The window can be moved around by dragging any point."""
2 |
3 | import webview
4 |
5 | if __name__ == '__main__':
6 | # Create a resizable webview window with minimum size constraints
7 | webview.create_window('Frameless window', 'http://pywebview.flowrl.com/hello',
8 | frameless=True, easy_drag=True)
9 | webview.start()
10 |
--------------------------------------------------------------------------------
/examples/fullscreen.py:
--------------------------------------------------------------------------------
1 | """Create a fullscreen window."""
2 |
3 | import webview
4 |
5 | if __name__ == '__main__':
6 | # Create a non-resizable webview window with 800x600 dimensions
7 | webview.create_window(
8 | 'Full-screen window', 'https://pywebview.flowrl.com/hello', fullscreen=True
9 | )
10 | webview.start()
11 |
--------------------------------------------------------------------------------
/examples/get_current_url.py:
--------------------------------------------------------------------------------
1 | """Print current URL after page is loaded."""
2 |
3 | import webview
4 |
5 |
6 | def get_current_url(window):
7 | print(window.get_current_url())
8 |
9 |
10 | if __name__ == '__main__':
11 | window = webview.create_window('Get current URL', 'https://pywebview.flowrl.com/hello')
12 | webview.start(get_current_url, window)
13 |
--------------------------------------------------------------------------------
/examples/get_elements.py:
--------------------------------------------------------------------------------
1 | """Get DOM elements using selectors."""
2 |
3 | import webview
4 |
5 |
6 | def get_elements(window):
7 | heading = window.get_elements('#heading')
8 | content = window.get_elements('.content')
9 | print('Heading:\n %s ' % heading[0].node['outerHTML'])
10 | print('Content 1:\n %s ' % content[0].node['outerHTML'])
11 | print('Content 2:\n %s ' % content[1].node['outerHTML'])
12 |
13 |
14 | if __name__ == '__main__':
15 | html = """
16 |
17 |
18 |
Heading
19 |
Content 1
20 |
Content 2
21 |
22 |
23 | """
24 | window = webview.create_window('Get elements example', html=html)
25 | webview.start(get_elements, window)
26 |
--------------------------------------------------------------------------------
/examples/hide_window.py:
--------------------------------------------------------------------------------
1 | """Programmatically hide and show window."""
2 |
3 | import time
4 |
5 | import webview
6 |
7 |
8 | def hide_show(window):
9 | print('Window is started hidden')
10 |
11 | time.sleep(5)
12 | print('Showing window')
13 | window.show()
14 |
15 | time.sleep(5)
16 | print('Hiding window')
17 | window.hide()
18 |
19 | time.sleep(5)
20 | print('And showing again')
21 | window.show()
22 |
23 |
24 | if __name__ == '__main__':
25 | window = webview.create_window(
26 | 'Hide / show window', 'https://pywebview.flowrl.com/hello', hidden=True
27 | )
28 | webview.start(hide_show, window)
29 |
--------------------------------------------------------------------------------
/examples/http_server.py:
--------------------------------------------------------------------------------
1 | """A built-in HTTP server example."""
2 |
3 | import webview
4 |
5 | if __name__ == '__main__':
6 | webview.create_window('My first HTML5 application', 'assets/index.html')
7 | # HTTP server is started automatically for local relative paths
8 | webview.start(ssl=True)
9 |
--------------------------------------------------------------------------------
/examples/icon.py:
--------------------------------------------------------------------------------
1 | """Set window icon using `webview.start(icon=). This is supported only on GTK and QT. For other
2 | platforms, icon is set during freezing."""
3 |
4 | import webview
5 |
6 | if __name__ == '__main__':
7 | window = webview.create_window('Set window icon', 'https://pywebview.flowrl.com/hello')
8 | webview.start(icon='../logo/logo.png')
9 |
--------------------------------------------------------------------------------
/examples/links.py:
--------------------------------------------------------------------------------
1 | import webview
2 |
3 | """
4 | Demonstrate a difference between different link types
5 | """
6 |
7 |
8 | html = """
9 |
10 |
11 |
12 |
')
15 | webview.start(third_window)
16 |
--------------------------------------------------------------------------------
/examples/on_top.py:
--------------------------------------------------------------------------------
1 | """Create a window that stays on top of other windows."""
2 |
3 | import time
4 | import webview
5 |
6 |
7 | def deactivate(window):
8 | # window starts as on top of and reverts back to normal after 20 seconds
9 | time.sleep(20)
10 | window.on_top = False
11 | window.load_html('
This window is no longer on top of other windows
')
12 |
13 |
14 | if __name__ == '__main__':
15 | # Create webview window that stays on top of, all other windows
16 | window = webview.create_window(
17 | 'Topmost window', html='
14 |
15 |
16 | """
17 |
18 |
19 | if __name__ == '__main__':
20 | print(webview.settings)
21 | webview.settings['OPEN_EXTERNAL_LINKS_IN_BROWSER'] = False
22 | webview.settings['OPEN_DEVTOOLS_IN_DEBUG'] = False
23 |
24 | window = webview.create_window('Application flags', html=html)
25 | webview.start()
26 |
--------------------------------------------------------------------------------
/examples/simple_browser.py:
--------------------------------------------------------------------------------
1 | """The most basic example of creating a webview window."""
2 |
3 | import webview
4 |
5 | if __name__ == '__main__':
6 | # Create a standard webview window
7 | window = webview.create_window('Simple browser', 'https://pywebview.flowrl.com/hello')
8 | webview.start()
9 |
--------------------------------------------------------------------------------
/examples/todos/README.md:
--------------------------------------------------------------------------------
1 |
2 | A simple app built with a relative url and JS API.
3 |
4 |
5 | This example has code adapted from [TodoMVC](https://github.com/tastejs/todomvc) released under MIT license.
6 |
7 | LICENSE
8 |
9 | Copyright (c) Addy Osmani, Sindre Sorhus, Pascal Hartig, Stephen Sawchuk.
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 |
--------------------------------------------------------------------------------
/examples/todos/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Todos
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |