fable-compiler / samples-electron

Fable bindings and samples for Github Electron
Apache License 2.0
60 stars 12 forks source link

added browser sample using electron webview #3

Closed aolney closed 8 years ago

aolney commented 8 years ago

@alfonsogarciacaro I've put the webview you helped me with into a new sample. The sample presents a browser, using webview, with some associated controls, using react and elmish.

The most interesting thing perhaps is the use of callbacks on webview, which are necessary to adjust the nav bar when the pages complete their loads. I set these in componentDidMount after a lot of trial and error.

alfonsogarciacaro commented 8 years ago

So you're playing reflecting mirrors: simulating a browser in a desktop app using Electron which simulates a desktop app by embedding a browser ;) Cool, I'll check right away. Thanks a lot for this!

alfonsogarciacaro commented 8 years ago

Hi @aolney! I tried to run your sample but at the end of compilation, webpack failed with a lot of errors like: File to import not found or unreadable: ./app/css/_config.scss. I tried to edit webpack.config.js following the instructions here and managed to run webpack, but when I started the app nothing showed up and there was only one error in the debug console: Not allowed to load local resource.

Any ideas?

aolney commented 8 years ago

I think it is a .gitignore problem, but I'm not sure I fully understand why. For some reason the app directory in samples/browser is getting ignored when I add/commit/push. However I have css/_config.scss there as well as index.html, so the app directory is essential for compilation. I made another repository that is identical with just the browser sample and it clones fine. I'm stumped.

alfonsogarciacaro commented 8 years ago

Cool, the repo is working! Thanks for that, and don't worry, I'll figure out how to make it work :+1: