Running JavaScript file in Chrome

I would like to run a local javascript file in the Chrome console, but don't want to copy and paste the code. I know that there is a command that I can run from the terminal to open the file on a new chrome window / tab, but I can’t remember it and not find it online.

What command can I call from the terminal to open the .js file in a new Chrome tab, where can I launch it in the console?

+4
source share
1 answer

I don’t think you can do just that. To start JS with access to the console, you can either copy its source to the console or into the address bar / address bar ( javascript:(js code here)).

, , - JS HTML chrome -u file:///path/to/file.html. JS <script> file:/// src, .

chrome , /, , .

+1

All Articles