Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element no longer works in IE11 due to URL API usage #128

Open
6 tasks
brettpostin opened this issue Jun 3, 2017 · 1 comment
Open
6 tasks

Element no longer works in IE11 due to URL API usage #128

brettpostin opened this issue Jun 3, 2017 · 1 comment

Comments

@brettpostin
Copy link

Description

After upgrading to Polymer 2 and webcomponents v1, iron-component-page no longer works in IE11.

It fails in the _srcChanged function on the use of the URL api:

} else if (this.src) {
    srcUrl = new URL(this.src, this.base).toString();
} else {
    var base = _baseUrl(this.base);
    srcUrl = new URL(base.match(/([^\/]*)\/$/)[1] + ".html", base).toString();
}

IE11 does not support this API. Checking the source history I noticed the element has used this API since it's creation, which made me wonder how my app previously worked in Polymer 1.x.

I believe the URL api was previously polyfilled in the webcomponents.js suite. It no longer appears to be in the new v1 polyfills.

Steps to reproduce

The following code sample demonstrates the lack of availability of the URL api in IE11 after loading the polyfills.

<!doctype html>
<html>
<head>
</head>
<body>
    <script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
    <link rel="import" href="/bower_components/polymer/polymer.html">
    <script>
        var x = new URL('http://helloworld.com');
        console.log(x);
    </script>
</body>
</html>

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • [ X ] IE 11
  • [ X ] IE 10
@MrMcGibblets
Copy link

Hey,

Yes, you are correct, the URL polyfill was removed from the webcomponents.js suite.

I believe this was a breaking change that was introduced on purpose, I think what they are trying to do is in 2.0 give us more freedom on the polyfills we use.

See the below issue raised on the iron-location element and in particular Elliott Marquez's(e111077) response.

PolymerElements/iron-location#74

Hopefully, this helps you and you can import the polyfill yourself, or at least a bit more background to this issue.

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

No branches or pull requests

2 participants