How to add customElements support for Opera 12?

Asked

Viewed 82 times

6

I’m working with customElements, but I’ve been having problems with Opera 12.

So far the best I could do is use x-tags but the same of support only to the document.register and this differs a little from the API proposed by W3C, another drawback is that it does not support the document.registerElement.

Continuing my research I found the Polymer-project which is quite promising and in Webkit worked very well, but in Opera, when executed the plataform.js of Polymer, this causes subsequent scripts to start giving errors, for example stopping connection with websocket and can even run the polymer.js to add customElements support.

Based on this information, I wonder if someone could help me with a consistent solution for Opera, which does not break the native implementations of it and support document.registerElement as close as possible to the W3C draft API.

1 answer

5


After much research on the subject, I discovered that there is a polyfill that was made by the Polymer team, which is independent of the plataform.js and adds modern browser support to Custom Elements in a complete way.

https://github.com/Polymer/CustomElements

I did tests with this independent lib of Polymer with Opera 12 and succeeded in using the methods document.register and document.registerElement with all features documented in the current W3C draft.

Just for the sake of argument, this lib adds only the features needed for Custom Elements. Htmlimport, Object.Observer and other features used in Polymer must be loaded separately if you wish to use them.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.