3 ms·
Not sure what you're referring to. Files opened from disk in Firefox aren't forbidden from running JS.
by cxr 3y ago
Not 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)"; });