Giter Club home page Giter Club logo

electron-wasm-rust-example's People

Contributors

anderejd avatar arbitrix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-wasm-rust-example's Issues

`unsafe-eval` chromium workaround

It would be nice to get rid of this warning:

VM92 security-warnings.js:170 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
    Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    this app to unnecessary security risks.
 
For more information and help, consult
https://electronjs.org/docs/tutorial/security.
 This warning will not show up
once the app is packaged.

The cause of this is documented in index.html:

<!DOCTYPE html>
<html>
  <head>
    <base href="app://./" />
    
    <!--
      'unsafe-eval' is required because of a Chrome bug(?) that disallows
      loading WASM from 'self'.
      
      https://github.com/anderejd/electron-wasm-rust-example/issues/6
      https://github.com/WebAssembly/content-security-policy/issues/7
      https://bugs.chromium.org/p/chromium/issues/detail?id=948834&can=1&q=wasm-eval
    -->
    <meta http-equiv="Content-Security-Policy" content="script-src 'self' app: 'unsafe-eval'; object-src 'self' app:;">

    <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
  <script type="module" src="./main_module.js"></script>
  </body>
</html>

Hopefully a future chromium update will allow loading WebAssembly without 'unsafe-eval'.

Deprecation warnings

Electron Deprecation Warning (nodeIntegration default change) This window has node integration enabled by default. In Electron 5.0.0, node integration will be disabled by default. To prepare for this change, set {nodeIntegration: true} in the webPreferences for this window, or ensure that this window does not rely on node integration and set {nodeIntegration: false}.

Electron Deprecation Warning (contextIsolation default change) This window has context isolation disabled by default. In Electron 5.0.0, context isolation will be enabled by default. To prepare for this change, set {contextIsolation: false} in the webPreferences for this window, or ensure that this window does not rely on context isolation being disabled, and set {contextIsolation: true}.

For more information, see https://electronjs.org/docs/tutorial/security#3-enable-context-isolation-for-remote-content

Does not start on Linux.

Pop_OS 18.10.

app://./wasm/wasm_bi…inimal_example.js:1 Failed to load resource: net::ERR_NOT_IMPLEMENTED

npm start fails

I'm a complete noob, so take a grain of salt.

When npm starting, I get:

App threw an error during load
TypeError: protocol.registerStandardSchemes is not a function
    at Object.<anonymous> (/home/m/archive/development/rust/distrox/main.js:58:10)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
    at Module.load (internal/modules/cjs/loader.js:677:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
    at Function.Module._load (internal/modules/cjs/loader.js:601:3)
    at loadApplicationPackage (/nix/store/nd6cx53vcq2ai2l0nlss3qqzl52xfhjk-electron-5.0.0/lib/electron/resources/default_app.asar/main.js:105:12)
    at Object.<anonymous> (/nix/store/nd6cx53vcq2ai2l0nlss3qqzl52xfhjk-electron-5.0.0/lib/electron/resources/default_app.asar/main.js:153:5)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: protocol.registerStandardSchemes is not a function
    at Object.<anonymous> (/home/m/archive/development/rust/distrox/main.js:58:10)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
    at Module.load (internal/modules/cjs/loader.js:677:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
    at Function.Module._load (internal/modules/cjs/loader.js:601:3)
    at loadApplicationPackage (/nix/store/nd6cx53vcq2ai2l0nlss3qqzl52xfhjk-electron-5.0.0/lib/electron/resources/default_app.asar/main.js:105:12)
    at Object.<anonymous> (/nix/store/nd6cx53vcq2ai2l0nlss3qqzl52xfhjk-electron-5.0.0/lib/electron/resources/default_app.asar/main.js:153:5)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.