Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Invoke-WebRequest causing IE to open on its own when html is parsed

$
0
0
If IE is not set at the default browser, parsing the results `$R.ParsedHtml` after an Invoke-WebRequest results in this pop-up:

You'll need a new app to open this about
If IE <em>is</em> set as the default browser, it's worse.  IE opens to a blank page: `about:/UserSettings/ScreenSize`

IE opens many times

It has this same behavior running the script in Powershell Windows 2012R2.  Disabling the store only removes the reference to the store, yet the pop-up still appears.  With option `-UseBasicParsing` the dialogue box does not appear, however, `-UseBasicParsing` is not an option for the parsing I need to do.

This following solution indicates `onload` within the `<script>` in the parsed html is the problem when the default browser is not IE.
https://social.technet.microsoft.com/Forums/Windows/en-US/8955242b-51fb-4165-b263-e433f67f00c9/invokewebrequest-causes-look-for-an-app-in-the-store?forum=ITCG

I cannot understand what about `$R.parsedHtml` is causing an open event.

The html body starts with the form action and seems to be the culprit:

    <body>
        <form action="/UserSettings/ScreenSize" id="screen-size" name="screen-size" method="post">
        <input type="hidden" name="width" id="screen-size-width" value="0" />
        <input type="hidden" name="height" id="screen-size-height" value="0" />
    </form>

Why is it causing a browser to open or the pop-up?

Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>