Skip to content

Commit bbfe1d2

Browse files
authored
Merge pull request #96 from sigmaSd/f
only block for webui apis on darwin
2 parents 684554f + 5470b9a commit bbfe1d2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

examples/custom_web_server/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<h3>Custom Web-Server Example (C)</h3>
1111
<p>
1212
This HTML page is handled by a custom Web-Server other than WebUI.<br />
13-
This window is connected to the back-end because we used: <pre
14-
>http://localhost:8081/webui.js</pre>
13+
This window is connected to the back-end because we used:
14+
<pre>http://localhost:8081/webui.js</pre>
1515
</p>
1616
<h4><a href="second.html">Simple link example (Local file)</a></h4>
1717
<button onclick="myBackendFunc(123, 456, 789);">

src/lib.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ const symbols = {
1919
// bool webui_show(size_t window, const char* content)
2020
parameters: ["usize", "buffer"],
2121
result: "bool",
22+
// https://github.com/webui-dev/deno-webui/issues/91
23+
nonblocking: Deno.build.os !== "darwin",
2224
},
2325
webui_show_browser: {
2426
// bool webui_show_browser(size_t window, const char* content, size_t browser)
2527
parameters: ["usize", "buffer", "usize"],
2628
result: "bool",
29+
// https://github.com/webui-dev/deno-webui/issues/91
30+
nonblocking: Deno.build.os !== "darwin",
2731
},
2832
webui_interface_bind: {
2933
// size_t webui_interface_bind(size_t window, const char* element, void (*func)(size_t, size_t, char*, size_t, size_t));

src/webui.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export class WebUI {
9696
* // Await to ensure WebUI.script and WebUI.run can send datas to the client
9797
* console.assert(myWindow.isShown, true)
9898
* ```
99+
* @note this function blocks on macos
99100
*/
100101
async show(content: string) {
101102
const status = await this.#lib.symbols.webui_show(
@@ -141,6 +142,7 @@ export class WebUI {
141142
* // Await to ensure WebUI.script and WebUI.run can send datas to the client
142143
* console.assert(myWindow.isShown, true)
143144
* ```
145+
* @note this function blocks on macos
144146
*/
145147
async showBrowser(
146148
content: string,

0 commit comments

Comments
 (0)