4 ms·
Electron entered the chat.
by baal80spam 3y ago
Electron entered the chat.
- deleted 3y ago[deleted]
- Dwedit 3y agoI 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.
- mjburgess 3y agoThey would also, presumably, need to provide a whole native OS api for a variety of syscalls (etc.) that wouldnt otherwise be supported.
- crabmusket 3y agoExactly. Electron provides a backend which allows filesystem access, device access, etc. which a plain web app cannot get access to.
- Bene592 3y agoThey could ship a web server that listens on 127.0.0.1 and launches the standard browser
- deleted 3y ago[deleted]
- cxr 3y agoNot sure what you're referring to. Files opened from disk in Firefox aren't forbidden from running JS.
- Dwedit 3y agoFiles 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.
- cxr 3y ago~/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)"; });