Dukweeno / Duckuino

Simple DuckyScript to Arduino C converter.
https://dukweeno.github.io/Duckuino/
MIT License
353 stars 117 forks source link

Duckuino is not compiling when using local webpage from the zipped folder. #111

Closed syk0tek closed 3 years ago

syk0tek commented 3 years ago

-The Compile button is not clickable after writing/pasting the ducky script into the input text. The live version doesn't act normally and compiles the script.

How to reproduce the bug Steps to reproduce the behavior:

  1. Download the zipped folder and extract it
  2. Open the website "index" provided in the zipped folder which uses the local files instead of using the live version

Expected behavior The compile button should be clickable after writing/pasting the script as it does in the live version.

lowlevl commented 3 years ago

Hello @syk0tek, thanks for your report,

this is totally expected as the page uses an XHR request to get configuration files(modules/modules.json) and due to CORS behavior on local files, it blocks the request, generating a Javascript exception. Unfortunately this is not fixable, it comes from how browsers protect your local files from attackers, however if you want to use it on your local computer without an internet connection, you can still use a local HTTP server and copy Duckuino files to the server, and then accessing them via HTTP.

If you have the php command installed you can create a standalone server by typing the php -S 127.0.0.1:8080 in the Duckuino server, and then accessing it via http://127.0.0.1:8080

Have a good day or night :)