-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
browser/layout/partials/ctm.html
Outdated
try { | ||
getRandomValuesAvailable = 'getRandomValues' in window.crypto | ||
} catch (e) { | ||
getRandomValuesAvailable = 'getRandomValues' in window.msCrypto |
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 this also be in a try/catch to prevent errors on non-IE browsers which don't support .crypto
?
Alternatively avoid the whole nasty try catch with:
var crypto = window.crypto || window.msCrypto;
if (crypto) {
getRandomValuesAvailable = 'getRandomValues' in crypto;
}
maybe?
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 this be updated in http://origami.ft.com/docs/developer-guide/modules/core-vs-enhanced-experience/#1-define-the-test ?
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.
(yes)
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.
God yes, that is much nicer 🤦♂️ And a good point about non-IE browsers
It doesn't work 🙈 |
On 4.x? Ouch 🙈 I did only test it on a Nexus and iPhone... |
Doesn't seem to, no |
browser/layout/partials/ctm.html
Outdated
getRandomValuesAvailable = 'getRandomValues' in cryptoApi; | ||
var supportsBlobConstructor; | ||
try { | ||
new Blob; |
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.
This looks like it also knocks out UCBrowser (10% global usage???). Is that intentional?
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.
YAY! don't have to worry!
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.
Looks like you've excluded a Sauce browser of some variety though ;)
browser/layout/partials/ctm.html
Outdated
if (window.cutsTheMustard) { | ||
alert('cuts the mustard') |
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.
no need for the alert
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.
Yes I've noticed that 🙈
… rhys/polyfill-config * 'master' of https://github.com/Financial-Times/n-ui: Make Android Browser 4 core (#911) Rhys/decouple asset hashing (#920)
… rhys/brotli-again * 'master' of https://github.com/Financial-Times/n-ui: Make Android Browser 4 core (#911) Rhys/decouple asset hashing (#920)
No description provided.