Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

How to start javascript from command prompt with window object loaded ?

  • I'm writing a program that needs to start opera, load a page and run some javascript.
    I've been able to run multiple statements as follows:

    launcher.exe "javascript:alert('hello')"; etc.

    The problem is that if I enter something like this

    launcher.exe "javascript:alert('hello');"

    it will open in one window, and run the javascript in a new, empty window!
    To solve this, I'm trying to load the page with the javascript command"","_self")

    However, the problem is that the empty page it opens to run the javascript DOES NOT SEEM TO CONTAIN THE WINDOW OBJECT!!
    Help please,

  • Sorry my mistake, it actually works with location= . How can I delete this post ?