1

I already have a batch file containing this command:

start firefox -new-tab www.google.de

Now I want to execute js code on this page automatically, like:

alert('Hello World!');

Just like you can do it in the js console of firefox...

I do not own the website. I want it to make it work with other websites like google.de ...

Obviously I am using firefox and windows.

Thanks in advance!

2
  • You can use somthing like Tampermonkey to run custom js on web page. Commented Nov 11, 2017 at 12:42
  • Thanks, works fine. Commented Nov 11, 2017 at 14:01

1 Answer 1

1

Do you have an HTML page?

If you do, you can use the HTML to run the Javascript like this:

<script>
   alert('Hello World!');
</script>

And use the batch file to run the HTML file instead. For example, if your HTML page was in this location: file:///C:/Users/user/Desktop/page.html, you would run the following:

start "" "(location of your firefox program)" "file:///C:/Users/user/Desktop/page.html"

Hope it helped.

Sign up to request clarification or add additional context in comments.

1 Comment

No, that's not what i wanted. But Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.