IE9 “Can't execute code from freed script” whe

2019-08-04 11:16发布

Here is the scenario:

I have a container page that swaps iFrames in and out to show different content. All iFrames come from the same domain. https is enabled.

  • The container page has an object called Flow, with functions set/getParameter
  • The first iFrame, s0-welcome, creates an object, data, and calls Flow.setParameter('data', data);
  • The container then replaces the first iFrame with a second iFrame, s1-transfer.
  • The s1-transfer calls Flow.getParameter('data') and stores it in a local variable s1data

In the IE9 debug tools console, if I type s1data it shows me all the properties of that object. However, if I call s1data.hasOwnProperty('prop1'), I get a "Can't execute code from a freed script" error. If I call Object.prototype.hasOwnProperty.call(s1data, "prop1"), everything works fine.

It looks to me that there can be 2 possibilities:

1) Container page holds on to the reference from the first iFrame, but when the first iFrame gets disposed, it loses some of the data. This seems unlikely since the only thing I can't access is functions

2) There is a security restriction that does not allow one iFrame to run code related to another iFrame even if both iFrames are from the same domain.

Any thoughts?

1条回答
混吃等死
2楼-- · 2019-08-04 12:07

Just ran into a similar issue. For me, simply changing s1data.hasOwnProperty('prop1') into ('prop' in s1data) made the error go away.

查看更多
登录 后发表回答