failed frame access in IE 11

Started by RAK, February 09, 2015, 08:01:55 AM

Previous topic - Next topic

RAK

I have hundreds of users running a script that has worked well for years until IE 11. It reads data inside a frame. The code does find the target frame but the same code that works fine in all earlier versions of IE generates an error in IE 11. It can not obtain the .document object inside the frame.

I have looked for new settings that may effect frames access and found no resolution. I would like to avoid navigating to the frame if possible.

Anyone heard of this issue?

thanks
Roy

td

This subject has  been touched on numerous times on this forum.  Perhaps start by performing a forum search on the word 'frame'. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

RAK

Hi thanks but I tried that already and read through them - some of them posted by me when IE 9 was released. My issue only appears in IE 11 and functions well with IE 10 and below.

It does not currently navigate to the frame as all I require is to read its' content.  I wish to avoid navigation as I have with IE 10 and below. I do not need to enter any data or click anything in it, just read object contents.  In multiple machines, if I downgrade to IE 10 or below - it works fine..

thanks

td

The following topic

http://forum.winbatch.com/index.php?topic=1181.0

which you participated in covers the topic for IE 11.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Don't know how you are accessing frames in your scripts but one point worth considering is that the 'getElementBy*' functions have changed behavior in resent versions of IE.  These changes have been known to break scripts. 

You have probably already looked the page of IE 11 changes but in case you haven't   

https://msdn.microsoft.com/en-us/library/ie/bg182625%28v=vs.85%29.aspx
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

RAK

frames = browser.document.frames
targetframe = frames.item(0)
THE ABOVE WORKS IN IE up to and including v11

framedoc = targetframe.document
THE ABOVE  WORKS ONLY IN IE up to 10. In IE 11, it generates an OLE error. 

I have not seen any confirmation that this should be so. I have tested the frame url and I will be able to navigate to it to access the data but it must be repeated many times - I wanted to avoid that as it sometimes must be repeated hundreds of times so speed is an issue.

If there is no solution I will test for the IE version and open the frame in a separate invisible tab to obtain data - then close it. I have found it to be much faster when it does not have to create the visible page.

NOTE/TIP: in most all cases I have seen -  if the frame url is navigated to in a new tab instead of a new window - secure login status is retained. The opposite is true if a new IE window is used - the new page is logged out.

ie_version = strsub (iGetIEVer(),1,1)
if ie_version > 10
   targetframe = frames.item(0)
   ... code to grab frame url
   navOpenInNewTab = 2048
   navOpenInBackgroundTab = 4096
   browser.navigate('frameurl.htm',navOpenInBackgroundTab)
   ... code to grab page and data
else
   targetframe = frames.item(0)
   framedoc = targetframe.document
endif

Thanks
Roy





td

I think this was covered in the topic discussion linked to above but you could try something like

Code (winbatch) Select

; IE 11
doc = targetframe.contentDocument.document


or

Code (winbatch) Select

; Older IE or no doctype.
doc = targetframe.contentWindow.document


I know the above does not work with IE 11 across domains or protocols per MSFT but don't know if the above works with frames in the same domain and using the same protocol.  Since you mentioned 'secure login status', you are likely attempting to navigate across a domain or protocol.  If that is the case, navigation to the frame is the only method I am aware of that will work with IE 11.   The invisible tab idea seems to be a clever solution.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

A quick test suggests that the 'contentDocument' method is more or less worthless when using IE 11's COM Automation DOM implementation to investigate frame elements without crossing a domain. It does seem to work when using javascript to access the DOM directly, however.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

RAK

Quote from: td on February 10, 2015, 07:27:14 AM
It does seem to work when using javascript to access the DOM directly, however.

I am experienced in WB, PHP, and SQL but only slightly familiar with javascript. Do you have any samples or suggestions on where I might learn about how to use it for this solution? I would expect it would require separate .js files(s) or can it be embedded in WB? If separate files are required. I would probably not want to use it here to avoid distribution and update issues.

Thanks for your replies!
Roy

td

It used to be relatively easy to inject javascript using an IE COM Automation DOM method but you guessed it.  That relatively easy bit of functionality has been disabled in IE 11.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade