browser functions in electronjs

25 views
Skip to first unread message

Bernd Grams

unread,
Apr 2, 2020, 6:02:55 AM4/2/20
to BiwaScheme
Hi,

thank you all for BiwaScheme. Its a great work!

I try to use BiwaScheme as primary language for developping node.js electron apps. Electron uses the chromium browser as a frontend. I tried to use the biwascheme browser functions to access html elements in chromium, but it doesn't work because biwascheme has recognized node.js and switched the feature off as I believe. Would it be possible to allow browser functions in chromium? 

Thanks for any answer.

Bernd

Yutaka Hara

unread,
Apr 2, 2020, 9:32:11 AM4/2/20
to biwas...@googlegroups.com
Hi,

I'm not sure what is the problem you are facing, but succeeded to run Scheme
code in index.html here:
Hope this helps.

2020年4月2日(木) 19:02 Bernd Grams <bern...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "BiwaScheme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biwascheme+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biwascheme/3c6ba681-6fd7-4be5-86d4-2bef4b4e58da%40googlegroups.com.


--
原 悠
Yutaka HARA

Bernd Grams

unread,
Apr 2, 2020, 12:57:53 PM4/2/20
to BiwaScheme
Hi,

thanks for your fast response. The version you have sent me runs indeed as expected.

But when I load BiwaScheme as node-module like this

<script type="text/javascript">
let biwascheme = require("biwascheme");
biwascheme.run_file("test.scm");
</script> 

and try to use ($ »#biwa«) within the loaded test.scm file I get the error 'unbound symbol: »$«'  (or 'unbound symbol: »getelem«')  

I have learned not to use BiwaScheme as node-module and load the biwascheme.js file the index.html.

Bernd

Am Donnerstag, 2. April 2020 15:32:11 UTC+2 schrieb yhara:
Hi,

I'm not sure what is the problem you are facing, but succeeded to run Scheme
code in index.html here:
Hope this helps.

2020年4月2日(木) 19:02 Bernd Grams <bern...@gmail.com>:
Hi,

thank you all for BiwaScheme. Its a great work!

I try to use BiwaScheme as primary language for developping node.js electron apps. Electron uses the chromium browser as a frontend. I tried to use the biwascheme browser functions to access html elements in chromium, but it doesn't work because biwascheme has recognized node.js and switched the feature off as I believe. Would it be possible to allow browser functions in chromium? 

Thanks for any answer.

Bernd

--
You received this message because you are subscribed to the Google Groups "BiwaScheme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biwas...@googlegroups.com.

Bernd Grams

unread,
Apr 3, 2020, 8:37:03 AM4/3/20
to BiwaScheme
Hi,

not to use BiwaScheme as node-module in electron allows me to use browser functionality in scheme. But in this case BiwaScheme doesn't recognize, that it is running in a node.js environment. When I try to use node functionality like 'file-exists?' BiwaScheme throws the error: the function 'file-exists?' is not supported in the browser (works only in Node.js)

In electron I would like to use both browser and node.js functions of BiwaScheme. Would this be possible?

best regards
Bernd

Yutaka Hara

unread,
Apr 3, 2020, 11:00:15 AM4/3/20
to biwas...@googlegroups.com
2020年4月3日(金) 21:37 Bernd Grams <bern...@gmail.com>:
not to use BiwaScheme as node-module in electron allows me to use browser functionality in scheme. But in this case BiwaScheme doesn't recognize, that it is running in a node.js environment. When I try to use node functionality like 'file-exists?' BiwaScheme throws the error: the function 'file-exists?' is not supported in the browser (works only in Node.js)

In electron I would like to use both browser and node.js functions of BiwaScheme. Would this be possible?

- By default you cannot call Node.js API in the index.html nor renderer.js,
  - You can change this by setting `nodeIntegration: true`, but you should be aware of the danger.
- You can use Node.js API in the preload.js.
- If you want to pass data from preload.js to index.html, you need to set `contextIsolation: false`.
 
To unsubscribe from this group and stop receiving emails from it, send an email to biwascheme+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biwascheme/ab5f13df-2470-4772-ad98-01b45a3009a9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages