Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Electron entered the chat.


I blame Firefox and other web browsers which deny loading JS files if your page was loaded from file://. If you could simply run an HTML file from your hard drive and have a fully functional web application, you wouldn't need Electron.


They would also, presumably, need to provide a whole native OS api for a variety of syscalls (etc.) that wouldnt otherwise be supported.


Exactly. Electron provides a backend which allows filesystem access, device access, etc. which a plain web app cannot get access to.


They could ship a web server that listens on 127.0.0.1 and launches the standard browser


Not sure what you're referring to. Files opened from disk in Firefox aren't forbidden from running JS.


Files opened from disk can run JS. But you can't do <script src="otherfile.js"> without getting a cross-origin error, even if it's in the same directory. So any kind of code organization at all is prohibited.


  ~/scratch/wrong$ cat ./index.html
  <!doctype html>
  <html>
  <head>
  <script src="otherfile.js"></script>
  </head>
  <body>
  <p>otherfile.js did not run</p>
  </body>
  </html>

  ~/scratch/wrong$ cat ./otherfile.js 
  window.onload = (() => {
    document.querySelector("p").textContent = "wrong.  (otherfile.js ran)";
  });




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: