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 www.yahoo.com "javascript:alert('hello');"

    it will open yahoo.com 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

    window.open("http://www.yahoo.com","_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,
    Thanks

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

Log in to reply
 

Looks like your connection to Opera forums was lost, please wait while we try to reconnect.