I’ve been writing a bunch of jest tests recently for libraries that use the underlying
window.crypto methods like
window.crypto.subtle key management methods. One problem I run into is that the
window.crypto object isn’t available, so I need to shim it.
To use the
window.crypto methods, you will need Node 15+. You can set the
window.crypto by importing the
crypto package and setting it on the global:
const crypto = require('crypto').webcrypto; // Shims the crypto property onto global global.crypto = crypto;
I really loathe creating mock functions for missing libraries in Node because they can lead to faulty positives on tests; I really appreciate
webcrypto being available!
9 Mind-Blowing WebGL Demos
As much as developers now loathe Flash, we’re still playing a bit of catch up to natively duplicate the animation capabilities that Adobe’s old technology provided us. Of course we have canvas, an awesome technology, one of which I highlighted 9 mind-blowing demos. Another technology available…
LightFace: Facebook Lightbox for MooTools
One of the web components I’ve always loved has been Facebook’s modal dialog. This “lightbox” isn’t like others: no dark overlay, no obnoxious animating to size, and it doesn’t try to do “too much.” With Facebook’s dialogue in mind, I’ve created LightFace: a Facebook lightbox…
I was recently scoping out the horrid source code of the Google homepage when I noticed the “Google Search” and “I’m Feeling Lucky” buttons had a style definition I hadn’t seen before: -webkit-appearance. The value assigned to the style was “push-button.” They are buttons so that…