Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

IE can't reload webcomponents.js on a framed page #6

Closed
JanMiksovsky opened this issue Nov 4, 2014 · 7 comments
Closed

IE can't reload webcomponents.js on a framed page #6

JanMiksovsky opened this issue Nov 4, 2014 · 7 comments

Comments

@JanMiksovsky
Copy link
Contributor

One common method to force a framed page (on the same domain) to reload is to invoke contentWindow.location.reload(). This method fails in IE if the framed page loads webcomponents.js.

To repro:

  1. Copy http://jsbin.com/ruceci/edit somewhere. This framing page just tries to frame another page. You'll need both it and the framed page to be on the same domain to avoid security constraints.
  2. Update the URL in the iframe so that it points to a target page on the same domain. It doesn't matter what the target page does, as long as it loads webcomponents.js. It doesn't need to load polymer.html.
  3. Open the framing page and click the Reload button.

On IE, this causes an exception to be thrown in HTMLElement.js, line 247:

  registerWrapper(OriginalHTMLElement, HTMLElement,
                  document.createElement('b'));

When the exception is thrown, OriginalHTMLElement is undefined.

This problem is not seen in Chrome, Firefox, and Safari.

@garlicnation
Copy link
Contributor

I've confirmed that this is still happening. document.createElementNS is undefined in Element.js in an iframe.

@sorvell It seems like we're somehow bashing over this function on document in the iframe's context. I have a minimal repro locally.

@garlicnation
Copy link
Contributor

Fixed in IE's March 10th patch.

@renatotrev
Copy link

I'm able to reproduce the same issue above using the release v0.7.15.

@misterbrownlee
Copy link

lurk mode: engaged

@aayush-nitb
Copy link

aayush-nitb commented Aug 24, 2016

I am facing same issue in IE 11.0.10240.17022 using webcomponents v0.7.22.

image

@mankowsj
Copy link

A naive fix would be inserting something like this on top of the webcomponents.js.
Tested on IE11; chrome 52; FF 48 with Polymer(1.6.1) and a simple component
webcomponents v0.7.22.

if (!document.createElement) {
    document.createElement = document.constructor.prototype.createElement;
    document.createElementNS = document.constructor.prototype.createElementNS;
    document.importNode = document.constructor.prototype.importNode;
}

@MagmaRules
Copy link

I'm running 0.17 in my project and ran into this problem. Updating to 0.22/0.23 did not fix the problem. Adding the fix from @proxyLaw solves the problem for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants