Hi,
 
    I am trying to call a JavaScript function from a Perl Win32::GUI application that automates Internet Explorer using Win32::OLE by creating an instance of the InternetExplorer object. Basically, I am trying to execute or call a JavaScript script function so that I can remotely control the web page.
 
Anyone have any experience doing this? Somethings I've read might indicate I need to learn the interfaces and events sinks for IE but I was hoping I could just do something like--
 
use Win32::OLE;
use Data::Dumper;
 
$ie = Win32::OLE->new("InternetExplorer.Application", \&quit)
 ||
die "FATAL ERROR - Failed to create instance of Internet Explorer!";
 
$ie->Navigation(http://www.myclient.com);
 
$ie->{document}->popup_contextmenu;
 
The corresponding HTML document would be--
 
<html>
 
<head>
<script language="JavaScript">
    document.popup_contextmenu = function() {
        // show custom context menu...
    }
</script>
</head>
<body>
....
</body>
</html>
 
Thanks!
Michael

Reply via email to