Detect the Content Type in the Clipboard
A user's clipboard is a "catch all" between the operating system and the apps employed on it. When you use a web browser, you can highlight text or right-click an image and select "Copy Image". That made me think about how developers can detect what is...
fetch with Timeout
A few years back I wrote a blog post about how write a
fetchPromise that times out. The function was effective but the code wasn't great, mostly because
AbortController, which allows you to cancel a fetch Promise, did not yet exist. With...
awaitto handle promises, or
finallywith callbacks, but what Promises don't tell...
Detecting Fonts Ready
Knowing when resources are loaded is a key part of building functional, elegant websites. We're used to using the
DOMContentLoadedevent (commonly referred to as "domready") but did you know there's an event that tells you when all fonts have loaded? Let's learn how...
How to Use Storage in Web Extensions
Working on a web extension is an interesting experience -- you get to taste web while working with special extension APIs. One such API is
storage-- the web extension flavor of persistence. Let's explore how you can use
Reading from and writing to the user's clipboard can be both a very useful and dangerous capability. Used correctly and it's a huge convenience to the user; used dubiously and the user could suffer catastrophic consequences. Imagine a wrong account number or wallet address...
An enjoyable web apps rely on engineers implementing the APIs that cover all of the small things. Those small things sometimes improve performance, usability, accessibility, and the app's relationship with its host system. The Wake Lock API is the latter -- an API...
Interacting with a user's host clipboard is something web developers have wanted for both good and evil purposes. On the good side, it's nice to allow users to easily copy text like wallet addresses or branch names; for evil, copying malicious text that the user...
Return a Default Value with Promises Using catch
Limit Promise Concurrency with pool
Promise.race, and the rest are really excellent for managing multiple Promises, allowing for our apps to embrace async and performance. There are times, however, that limiting the number of concurrent operations may be useful, like rate limiting or simply not wanting...