Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, I have a problems interacting with the Internet Explorer started as Win23::OLE-object after navigating to an intranet site. I've got the following code:
use Win32::OLE; use Win32::OLE::Variant; use strict; use warnings; my $IE = Win32::OLE->new('InternetExplorer.Application') or die "Unabl +e to create a IE Object\n"; $IE->{Visible} = 1; $IE->Navigate('http://www.google.com'); sleep 1 while($IE->{Busy}); $IE->Quit();

This script works fine, the Internet Explorer opens, goes to www.google.com and then closes again. But if I replace the www.google.com with an intranet address (or a https-page) the Internet Explorer opens, navigates to the page and stays open - while the script ends.

Could anyone please tell me why I cannot interact with the object any more after navigating to an intranet site?

Thanks in advance and best regards

  • Comment on Cannot interact with Internet explorer when navigating to intranet site
  • Download Code

Replies are listed 'Best First'.
Re: Cannot interact with Internet explorer when navigating to intranet site
by tobyink (Canon) on Mar 28, 2012 at 12:59 UTC

    It appears to be a "security feature". (In practice, probably "security theatre".)

    Try running your script as a more privileged user (e.g. as Administrator) and you may find it works.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      Hey,

      thank you very much for the hint, it turned out to be a very good one! Running the same script as admin closes the window with intranet sites as well.

      Best regards