Posts in category: "javascript"

A one-line solution to highlighting search matches

I’ve recently been making some improvements to the search page of this blog, and wanted to implement a feature where the search term was highlighted everywhere it appeared in the results. Although libraries for this exist, I wanted to try to implement it myself as it seemed like an...

Cache API 101

A cache is a form of storage for “requests” and “responses”. When you visited this page, you made a request for /cache-api-101. The response to that request was the HTML document you are viewing in your browser right now. The cache API allows us to store these requests and responses...

Going Offline First (Video Series)

You may have noticed that I recently updated this blog to allow for users like yourself to save an article to view offline. You can do this by clicking the bookmark icon above. If you are ever offline, you will still be able to view articles previously bookmarked. If you...

How to upload a screenshot from Puppeteer to Cloudinary

In my article yesterday, I wrote about the problem I was trying to solve with my caniuse embed. To recap, I was trying to create a fallback image for the live embed and I did this by taking a screenshot of the page using puppeteer. Yesterday, I covered how to...

Using a headless browser to capture page screenshots

A headless browser is a browser without the graphical user interface. It is a way to navigate the web via the command line. Headless browsers are useful for automating tests of websites as it allows us to navigate to a page and perform actions without having to manually open up...