| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en-US"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
| 6 |
<title>Javascript API | pywebview</title> |
| 7 |
<meta name="generator" content="VuePress 1.9.7"> |
| 8 |
|
| 9 |
<meta name="description" content="Build GUI for your Python program with JavaScript, HTML, and CSS"> |
| 10 |
|
| 11 |
<link rel="preload" href="/3.7/assets/css/0.styles.28a501df.css" as="style"><link rel="preload" href="/3.7/assets/js/app.10a559eb.js" as="script"><link rel="preload" href="/3.7/assets/js/2.0ff7ef1d.js" as="script"><link rel="preload" href="/3.7/assets/js/33.6ff70f11.js" as="script"><link rel="prefetch" href="/3.7/assets/js/10.f125ec08.js"><link rel="prefetch" href="/3.7/assets/js/11.81fead78.js"><link rel="prefetch" href="/3.7/assets/js/12.0a86c191.js"><link rel="prefetch" href="/3.7/assets/js/13.c09145fc.js"><link rel="prefetch" href="/3.7/assets/js/14.2a7dc35b.js"><link rel="prefetch" href="/3.7/assets/js/15.90c9f36a.js"><link rel="prefetch" href="/3.7/assets/js/16.69b1f4b4.js"><link rel="prefetch" href="/3.7/assets/js/17.956ed884.js"><link rel="prefetch" href="/3.7/assets/js/18.bd6678a0.js"><link rel="prefetch" href="/3.7/assets/js/19.b31e62b7.js"><link rel="prefetch" href="/3.7/assets/js/20.cebc4a71.js"><link rel="prefetch" href="/3.7/assets/js/21.d2041966.js"><link rel="prefetch" href="/3.7/assets/js/22.2a3916f2.js"><link rel="prefetch" href="/3.7/assets/js/23.712fbf84.js"><link rel="prefetch" href="/3.7/assets/js/24.f768e66b.js"><link rel="prefetch" href="/3.7/assets/js/25.69b3e415.js"><link rel="prefetch" href="/3.7/assets/js/26.6619f84a.js"><link rel="prefetch" href="/3.7/assets/js/27.e2a4e1bf.js"><link rel="prefetch" href="/3.7/assets/js/28.abcc819c.js"><link rel="prefetch" href="/3.7/assets/js/29.c379d080.js"><link rel="prefetch" href="/3.7/assets/js/3.749f6582.js"><link rel="prefetch" href="/3.7/assets/js/30.771e8640.js"><link rel="prefetch" href="/3.7/assets/js/31.547a8393.js"><link rel="prefetch" href="/3.7/assets/js/32.778a82c7.js"><link rel="prefetch" href="/3.7/assets/js/34.ae1b5fb4.js"><link rel="prefetch" href="/3.7/assets/js/35.c5555b94.js"><link rel="prefetch" href="/3.7/assets/js/36.d53c471f.js"><link rel="prefetch" href="/3.7/assets/js/37.bbba2d58.js"><link rel="prefetch" href="/3.7/assets/js/38.5eb30036.js"><link rel="prefetch" href="/3.7/assets/js/39.8cac65fe.js"><link rel="prefetch" href="/3.7/assets/js/4.f2c64e71.js"><link rel="prefetch" href="/3.7/assets/js/40.53182a9c.js"><link rel="prefetch" href="/3.7/assets/js/41.19399765.js"><link rel="prefetch" href="/3.7/assets/js/42.41128068.js"><link rel="prefetch" href="/3.7/assets/js/43.660f3959.js"><link rel="prefetch" href="/3.7/assets/js/44.09d5c6f8.js"><link rel="prefetch" href="/3.7/assets/js/45.4a818eab.js"><link rel="prefetch" href="/3.7/assets/js/46.d1621897.js"><link rel="prefetch" href="/3.7/assets/js/47.7f8f8dec.js"><link rel="prefetch" href="/3.7/assets/js/48.f27d4c39.js"><link rel="prefetch" href="/3.7/assets/js/49.4189d401.js"><link rel="prefetch" href="/3.7/assets/js/5.2a771d7d.js"><link rel="prefetch" href="/3.7/assets/js/50.beff8380.js"><link rel="prefetch" href="/3.7/assets/js/51.8a918a6c.js"><link rel="prefetch" href="/3.7/assets/js/52.92d0105f.js"><link rel="prefetch" href="/3.7/assets/js/53.28701cde.js"><link rel="prefetch" href="/3.7/assets/js/54.2b15d6fb.js"><link rel="prefetch" href="/3.7/assets/js/55.d231c742.js"><link rel="prefetch" href="/3.7/assets/js/56.7e02bbff.js"><link rel="prefetch" href="/3.7/assets/js/57.61e9e46c.js"><link rel="prefetch" href="/3.7/assets/js/58.cc70e253.js"><link rel="prefetch" href="/3.7/assets/js/59.d3f412e7.js"><link rel="prefetch" href="/3.7/assets/js/6.64e1f3ed.js"><link rel="prefetch" href="/3.7/assets/js/60.f4fd7728.js"><link rel="prefetch" href="/3.7/assets/js/61.cd0f1d68.js"><link rel="prefetch" href="/3.7/assets/js/62.bf000bcc.js"><link rel="prefetch" href="/3.7/assets/js/63.807edde1.js"><link rel="prefetch" href="/3.7/assets/js/64.2b6fe843.js"><link rel="prefetch" href="/3.7/assets/js/7.779cbcff.js"><link rel="prefetch" href="/3.7/assets/js/8.66fb3acb.js"><link rel="prefetch" href="/3.7/assets/js/9.84350af9.js"> |
| 12 |
<link rel="stylesheet" href="/3.7/assets/css/0.styles.28a501df.css"> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/3.7/" class="home-link router-link-active"><img src="/3.7/logo-no-text.png" alt="pywebview" class="logo"> <span class="site-name can-hide">pywebview</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/3.7/guide/" class="nav-link"> |
| 16 |
Guide |
| 17 |
</a></div><div class="nav-item"><a href="/3.7/examples/" class="nav-link router-link-active"> |
| 18 |
Examples |
| 19 |
</a></div><div class="nav-item"><a href="/3.7/contributing/" class="nav-link"> |
| 20 |
Contributing |
| 21 |
</a></div><div class="nav-item"><a href="/3.7/blog/" class="nav-link"> |
| 22 |
Blog |
| 23 |
</a></div><div class="nav-item"><a href="/3.7/CHANGELOG.html" class="nav-link"> |
| 24 |
Changelog |
| 25 |
</a></div> <a href="https://github.com/r0x0r/pywebview" target="_blank" rel="noopener noreferrer" class="repo-link"> |
| 26 |
GitHub |
| 27 |
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/3.7/guide/" class="nav-link"> |
| 28 |
Guide |
| 29 |
</a></div><div class="nav-item"><a href="/3.7/examples/" class="nav-link router-link-active"> |
| 30 |
Examples |
| 31 |
</a></div><div class="nav-item"><a href="/3.7/contributing/" class="nav-link"> |
| 32 |
Contributing |
| 33 |
</a></div><div class="nav-item"><a href="/3.7/blog/" class="nav-link"> |
| 34 |
Blog |
| 35 |
</a></div><div class="nav-item"><a href="/3.7/CHANGELOG.html" class="nav-link"> |
| 36 |
Changelog |
| 37 |
</a></div> <a href="https://github.com/r0x0r/pywebview" target="_blank" rel="noopener noreferrer" class="repo-link"> |
| 38 |
GitHub |
| 39 |
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <ul class="sidebar-links"><li><a href="/3.7/examples/cef.html" class="sidebar-link">CEF support</a></li><li><a href="/3.7/examples/change_url.html" class="sidebar-link">Change URL</a></li><li><a href="/3.7/examples/css_load.html" class="sidebar-link">CSS load</a></li><li><a href="/3.7/examples/close_confirm.html" class="sidebar-link">Quit confirmation dialog</a></li><li><a href="/3.7/examples/debug.html" class="sidebar-link">Debugging</a></li><li><a href="/3.7/examples/destroy_window.html" class="sidebar-link">Destroy window</a></li><li><a href="/3.7/examples/events.html" class="sidebar-link">Events</a></li><li><a href="/3.7/examples/frameless.html" class="sidebar-link">Frameless window</a></li><li><a href="/3.7/examples/fullscreen.html" class="sidebar-link">Fullscreen window</a></li><li><a href="/3.7/examples/get_elements.html" class="sidebar-link">Get DOM elements</a></li><li><a href="/3.7/examples/get_current_url.html" class="sidebar-link">Get current URL</a></li><li><a href="/3.7/examples/hide_window.html" class="sidebar-link">Hide / show window</a></li><li><a href="/3.7/examples/html_load.html" class="sidebar-link">HTML load</a></li><li><a href="/3.7/examples/js_evaluate.html" class="sidebar-link">Javascript evaluation</a></li><li><a href="/3.7/examples/js_api.html" aria-current="page" class="active sidebar-link">Javascript API</a></li><li><a href="/3.7/examples/loading_animation.html" class="sidebar-link">Loading animation</a></li><li><a href="/3.7/examples/links.html" class="sidebar-link">Link types</a></li><li><a href="/3.7/examples/localization.html" class="sidebar-link">Localization</a></li><li><a href="/3.7/examples/min_size.html" class="sidebar-link">Minimum window size</a></li><li><a href="/3.7/examples/minimize_window.html" class="sidebar-link">Minimize / restore window</a></li><li><a href="/3.7/examples/move_window.html" class="sidebar-link">Move window</a></li><li><a href="/3.7/examples/multiple_windows.html" class="sidebar-link">Multi-window</a></li><li><a href="/3.7/examples/open_file_dialog.html" class="sidebar-link">Open file dialog</a></li><li><a href="/3.7/examples/open_url.html" class="sidebar-link">Open URL</a></li><li><a href="/3.7/examples/resize_window.html" class="sidebar-link">Resize window</a></li><li><a href="/3.7/examples/save_file_dialog.html" class="sidebar-link">Save file dialog</a></li><li><a href="/3.7/examples/screens.html" class="sidebar-link">Screens</a></li><li><a href="/3.7/examples/toggle_fullscreen.html" class="sidebar-link">Toggle full-screen</a></li><li><a href="/3.7/examples/user_agent.html" class="sidebar-link">Change user agent string</a></li><li><a href="/3.7/examples/window_title_change.html" class="sidebar-link">Window title change</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="javascript-api"><a href="#javascript-api" class="header-anchor">#</a> Javascript API</h1> <p>Create an application without a HTTP server. The application uses Javascript API object to communicate between Python and Javascript.</p> <div class="language-python extra-class"><pre class="language-python"><code><span class="token keyword">import</span> threading |
| 40 |
<span class="token keyword">import</span> time |
| 41 |
<span class="token keyword">import</span> sys |
| 42 |
<span class="token keyword">import</span> random |
| 43 |
<span class="token keyword">import</span> webview |
| 44 |
|
| 45 |
|
| 46 |
html <span class="token operator">=</span> <span class="token triple-quoted-string string">""" |
| 47 |
<!DOCTYPE html> |
| 48 |
<html> |
| 49 |
<head lang="en"> |
| 50 |
<meta charset="UTF-8"> |
| 51 |
|
| 52 |
<style> |
| 53 |
#response-container { |
| 54 |
display: none; |
| 55 |
padding: 3rem; |
| 56 |
margin: 3rem 5rem; |
| 57 |
font-size: 120%; |
| 58 |
border: 5px dashed #ccc; |
| 59 |
} |
| 60 |
|
| 61 |
label { |
| 62 |
margin-left: 0.3rem; |
| 63 |
margin-right: 0.3rem; |
| 64 |
} |
| 65 |
|
| 66 |
button { |
| 67 |
font-size: 100%; |
| 68 |
padding: 0.5rem; |
| 69 |
margin: 0.3rem; |
| 70 |
text-transform: uppercase; |
| 71 |
} |
| 72 |
|
| 73 |
</style> |
| 74 |
</head> |
| 75 |
<body> |
| 76 |
|
| 77 |
|
| 78 |
<h1>JS API Example</h1> |
| 79 |
<p id='pywebview-status'><i>pywebview</i> is not ready</p> |
| 80 |
|
| 81 |
<button onClick="initialize()">Hello Python</button><br/> |
| 82 |
<button id="heavy-stuff-btn" onClick="doHeavyStuff()">Perform a heavy operation</button><br/> |
| 83 |
<button onClick="getRandomNumber()">Get a random number</button><br/> |
| 84 |
<label for="name_input">Say hello to:</label><input id="name_input" placeholder="put a name here"> |
| 85 |
<button onClick="greet()">Greet</button><br/> |
| 86 |
<button onClick="catchException()">Catch Exception</button><br/> |
| 87 |
|
| 88 |
|
| 89 |
<div id="response-container"></div> |
| 90 |
<script> |
| 91 |
window.addEventListener('pywebviewready', function() { |
| 92 |
var container = document.getElementById('pywebview-status') |
| 93 |
container.innerHTML = '<i>pywebview</i> is ready' |
| 94 |
}) |
| 95 |
|
| 96 |
function showResponse(response) { |
| 97 |
var container = document.getElementById('response-container') |
| 98 |
|
| 99 |
container.innerText = response.message |
| 100 |
container.style.display = 'block' |
| 101 |
} |
| 102 |
|
| 103 |
function initialize() { |
| 104 |
pywebview.api.init().then(showResponse) |
| 105 |
} |
| 106 |
|
| 107 |
function doHeavyStuff() { |
| 108 |
var btn = document.getElementById('heavy-stuff-btn') |
| 109 |
|
| 110 |
pywebview.api.doHeavyStuff().then(function(response) { |
| 111 |
showResponse(response) |
| 112 |
btn.onclick = doHeavyStuff |
| 113 |
btn.innerText = 'Perform a heavy operation' |
| 114 |
}) |
| 115 |
|
| 116 |
showResponse({message: 'Working...'}) |
| 117 |
btn.innerText = 'Cancel the heavy operation' |
| 118 |
btn.onclick = cancelHeavyStuff |
| 119 |
} |
| 120 |
|
| 121 |
function cancelHeavyStuff() { |
| 122 |
pywebview.api.cancelHeavyStuff() |
| 123 |
} |
| 124 |
|
| 125 |
function getRandomNumber() { |
| 126 |
pywebview.api.getRandomNumber().then(showResponse) |
| 127 |
} |
| 128 |
|
| 129 |
function greet() { |
| 130 |
var name_input = document.getElementById('name_input').value; |
| 131 |
pywebview.api.sayHelloTo(name_input).then(showResponse) |
| 132 |
} |
| 133 |
|
| 134 |
function catchException() { |
| 135 |
pywebview.api.error().catch(showResponse) |
| 136 |
} |
| 137 |
|
| 138 |
</script> |
| 139 |
</body> |
| 140 |
</html> |
| 141 |
"""</span> |
| 142 |
|
| 143 |
|
| 144 |
<span class="token keyword">class</span> <span class="token class-name">Api</span><span class="token punctuation">:</span> |
| 145 |
<span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 146 |
self<span class="token punctuation">.</span>cancel_heavy_stuff_flag <span class="token operator">=</span> <span class="token boolean">False</span> |
| 147 |
|
| 148 |
<span class="token keyword">def</span> <span class="token function">init</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 149 |
response <span class="token operator">=</span> <span class="token punctuation">{</span> |
| 150 |
<span class="token string">'message'</span><span class="token punctuation">:</span> <span class="token string">'Hello from Python {0}'</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>sys<span class="token punctuation">.</span>version<span class="token punctuation">)</span> |
| 151 |
<span class="token punctuation">}</span> |
| 152 |
<span class="token keyword">return</span> response |
| 153 |
|
| 154 |
<span class="token keyword">def</span> <span class="token function">getRandomNumber</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 155 |
response <span class="token operator">=</span> <span class="token punctuation">{</span> |
| 156 |
<span class="token string">'message'</span><span class="token punctuation">:</span> <span class="token string">'Here is a random number courtesy of randint: {0}'</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">100000000</span><span class="token punctuation">)</span><span class="token punctuation">)</span> |
| 157 |
<span class="token punctuation">}</span> |
| 158 |
<span class="token keyword">return</span> response |
| 159 |
|
| 160 |
<span class="token keyword">def</span> <span class="token function">doHeavyStuff</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 161 |
time<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">0.1</span><span class="token punctuation">)</span> <span class="token comment"># sleep to prevent from the ui thread from freezing for a moment</span> |
| 162 |
now <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span> |
| 163 |
self<span class="token punctuation">.</span>cancel_heavy_stuff_flag <span class="token operator">=</span> <span class="token boolean">False</span> |
| 164 |
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1000000</span><span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 165 |
_ <span class="token operator">=</span> i <span class="token operator">*</span> random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1000</span><span class="token punctuation">)</span> |
| 166 |
<span class="token keyword">if</span> self<span class="token punctuation">.</span>cancel_heavy_stuff_flag<span class="token punctuation">:</span> |
| 167 |
response <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token string">'message'</span><span class="token punctuation">:</span> <span class="token string">'Operation cancelled'</span><span class="token punctuation">}</span> |
| 168 |
<span class="token keyword">break</span> |
| 169 |
<span class="token keyword">else</span><span class="token punctuation">:</span> |
| 170 |
then <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span> |
| 171 |
response <span class="token operator">=</span> <span class="token punctuation">{</span> |
| 172 |
<span class="token string">'message'</span><span class="token punctuation">:</span> <span class="token string">'Operation took {0:.1f} seconds on the thread {1}'</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span><span class="token punctuation">(</span>then <span class="token operator">-</span> now<span class="token punctuation">)</span><span class="token punctuation">,</span> threading<span class="token punctuation">.</span>current_thread<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> |
| 173 |
<span class="token punctuation">}</span> |
| 174 |
<span class="token keyword">return</span> response |
| 175 |
|
| 176 |
<span class="token keyword">def</span> <span class="token function">cancelHeavyStuff</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 177 |
time<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">0.1</span><span class="token punctuation">)</span> |
| 178 |
self<span class="token punctuation">.</span>cancel_heavy_stuff_flag <span class="token operator">=</span> <span class="token boolean">True</span> |
| 179 |
|
| 180 |
<span class="token keyword">def</span> <span class="token function">sayHelloTo</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> name<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 181 |
response <span class="token operator">=</span> <span class="token punctuation">{</span> |
| 182 |
<span class="token string">'message'</span><span class="token punctuation">:</span> <span class="token string">'Hello {0}!'</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>name<span class="token punctuation">)</span> |
| 183 |
<span class="token punctuation">}</span> |
| 184 |
<span class="token keyword">return</span> response |
| 185 |
|
| 186 |
<span class="token keyword">def</span> <span class="token function">error</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> |
| 187 |
<span class="token keyword">raise</span> Exception<span class="token punctuation">(</span><span class="token string">'This is a Python exception'</span><span class="token punctuation">)</span> |
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span> |
| 192 |
api <span class="token operator">=</span> Api<span class="token punctuation">(</span><span class="token punctuation">)</span> |
| 193 |
window <span class="token operator">=</span> webview<span class="token punctuation">.</span>create_window<span class="token punctuation">(</span><span class="token string">'API example'</span><span class="token punctuation">,</span> html<span class="token operator">=</span>html<span class="token punctuation">,</span> js_api<span class="token operator">=</span>api<span class="token punctuation">)</span> |
| 194 |
webview<span class="token punctuation">.</span>start<span class="token punctuation">(</span><span class="token punctuation">)</span> |
| 195 |
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/r0x0r/pywebview/edit/docs/docs/examples/js_api.md" target="_blank" rel="noopener noreferrer">Help us improve this page!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev"> |
| 196 |
← |
| 197 |
<a href="/3.7/examples/js_evaluate.html" class="prev"> |
| 198 |
Javascript evaluation |
| 199 |
</a></span> <span class="next"><a href="/3.7/examples/loading_animation.html"> |
| 200 |
Loading animation |
| 201 |
</a> |
| 202 |
→ |
| 203 |
</span></p></div> </main></div><div class="global-ui"></div></div> |
| 204 |
<script src="/3.7/assets/js/app.10a559eb.js" defer></script><script src="/3.7/assets/js/2.0ff7ef1d.js" defer></script><script src="/3.7/assets/js/33.6ff70f11.js" defer></script> |
| 205 |
</body> |
| 206 |
</html> |