-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make yandex-metrica generated HTML a bit smaller #64
base: master
Are you sure you want to change the base?
Conversation
@@ -22,18 +22,16 @@ block('yandex-metrica').replace()(function() { | |||
' var n = d.getElementsByTagName("script")[0],', | |||
' s = d.createElement("script"),', | |||
' f = function () { n.parentNode.insertBefore(s, n); };', | |||
' s.type = "text/javascript";', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text/javascript
is default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, but why Metrica provides this attribute? May be it brings value for using in old browsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should care for such old browsers.
|
||
noScriptContent = { | ||
tag : 'div', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
div
is default value
' s.async = true;', | ||
' s.src = "https://mc.yandex.ru/metrika/watch.js";', | ||
'', | ||
' if (w.opera == "[object Opera]") {', | ||
' d.addEventListener("DOMContentLoaded", f, false);', | ||
' } else { f(); }', | ||
'})(document, window, "yandex_metrika_callbacks");' | ||
].join('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should safe ~35 bytes :)
please squash commits before merge |
I propose to implement it into a modifier. Something like I don't like to get minified script by default. Metrica provides script such our current template does. I'd like to save this behaviour. |
When you apply BEMHTML templates to BEMJSON you get minimized HTML. |
Ok, you're right. |
No description provided.