2

The JavaScript code below is not loading, in the JavaScript console it says,

"Not allowed to load local resource:"

Javascript:

    (function () { 
        var script = document.createElement('script'); 
        script.setAttribute('src','file:///home/chronos/u-1dd073c6b7b8430c0010c7429b07db331325c324/Downloads/Core/tube.js'); 
        document.body.appendChild(script);
        }()
    );
rajthakur
  • 443
  • 6
  • 16

2 Answers2

2

This stuff is mostly pasted from other questions but perhaps you will find it useful:

Check if your host is fully qualified in here

You can also read a guide in here

Some browsers, like modern versions of Chrome, will even refuse to cross from the http protocol to the file protocol. Chrome and Safari seem to use a more strict implementation of sandboxing (for security reasons) than the other two.

Finally, you shouldn't load javascript files off a local filesystem. You need to have it hosted with your app and load it off the web server.

Community
  • 1
  • 1
Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
0

Create a python server using

python3 -m http.server 8086

and replace the

file:///<PATH_TO_FILE>

with https://localhost:8086/<RELATIVE_PATH_TO_FILE>