Dealing with some relics of the past in our elements' implementation, we've hit a snag reaching into <template> elements externally to retrieve specific content. For example, we leave a <script id="ceci-definition"> in our elements which contains some meta data about the element. Looks like this:

Ugh, I would definitely avoid using that brittle JS statement. If the outside needs access to it (cleary you do), why avoid exposing this data as a property on the element?
–
ebidelApr 8 '14 at 20:34

Also note, to reach into an element's shadow dom, you can use .shadowRoot: document.querySelector(elementName).shadowRoot.querySelector(...)
–
ebidelApr 8 '14 at 20:42

if you have an instance of your polymer-element on the page, e.g. <foo-bar> you can get a hold of it and do .element, that way you don't have to go through the window.CustomElements.registry (which will totally not work with native custom elements). another trick: use document.createElement(elementName).element to get a hold of the polymer-element. Note this only works if you know it's a polymer-element and not some other kind of custom element.
–
jmesserlyApr 8 '14 at 20:55

Unfortunately, we need to get at this data before the element is instantiated/dropped on the page. :/
–
secretrobotronApr 8 '14 at 21:14

@jmesserly, that's a good idea. Want to avoid a potentially large memory footprint though. Means we'd have to instantiate an element to get at its meta-data, which is sub-optimal, I think.
–
secretrobotronApr 8 '14 at 21:18

Here is some sample code: jsbin.com/xokar/5/edit. I tried to capture a lot of detail and I may have made it inscrutable. Happy to clarify if I can. Also, I used polymer-meta (which is the old name for core-meta) because core-meta isn't in stable branch yet.
–
Scott MilesApr 11 '14 at 6:42