-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Firefox doesn't load script in template #465
Comments
Script seems to work when cloning a template directly: http://jsbin.com/kesepoca/1/edit I wonder if this has to do with ShadowDOM polyfill? |
Btw, I assume safari displays 'loaded' twice because we have to polyfill template element, and we can't polyfill the "script doesn't run" behavior, as the parser executes the script before the polyfill can touch the containing template element. |
Also btw, 'loaded twice' shouldn't happen in a import, where we can control parsing. |
Closing this issue due to age and the release of version 1 of Polymer - please feel free to re-open if this is incorrect. |
Still <script> does not get executed if placed inside any custom element in FF (in my case, in <paper-material>). But works in Chromium. |
See http://jsbin.com/huhis/1/edit. This logs the string "loaded" to the console in Chrome, Canary, and Safari — but not Firefox. (Separate bug: This displays "loaded" twice in Safari.
Background: I came across this case in trying to use a defer attribute on a script required by a analytics beacon element that would only be instantiated once per page. I wanted:
I couldn't work out how to sink an event handler on the script element's load event if the script tag were outside the template. I tried putting the script tag within the template, and that at least let me sink load with
on-load="{{loadedHandler}}"
. This worked everywhere in Firefox, which I isolated to the jsbin above.The text was updated successfully, but these errors were encountered: