Category: Javascript

getDisplayMedia vs. getUserMedia

I’ve been messing around with the browser API navigator.mediaDevices.getDisplayMedia(). The question I hoped to answer: can I capture the content in some computer display surface and push it through the same sorts of process that I use with .getUserMedia()? I tested on Google Chrome 84. Answer: yes. It has some quirks. It doesn’t need, and indeed rejects, elaborate constraints.  {… Read more →

New Microsoft Edge rolls out to everybody this month

About time! the new Chromium-based Edge browser will show up on Windows 10 machines in this month’s update. For the cancelled Internet Explorer and Legacy Edge project people, I would have more sympathy if their work products hadn’t baffled software developers for a quarter-century. IE and old Edge were in the uncanny valley of compatibility. They worked well enough that… Read more →

JSDoc configured

JSDoc is a way to put programmer documentation in Javascript code. It’s in the tradition of Doxygen , Javadoc, and C#’s documentation comments. And what a sorry tradition that is. Tools for extracting that kind of documentation and making, well, documents from it are just atrocious. (Set me straight in a comment if I’m wrong.)  Sure, the various IDEs use… Read more →

Handling errors in nodejs and express

Many people surely know all this by now. Still, here are some things I’ve recently learned about notifying clients (browsers, API clients) about errors. Delivering errors from route handlers to clients This is remarkably easy, once you figure it out. Just use the http-errors package. (Beware, not the http-error package; it does something different. Call next() with an object made… Read more →

From browser Javascript, how to tell if an image won’t load

Sometimes it’s necessary in Javascript in a browser to find out whether an image object loads correctly. You might do this to check whether a server is responding, or whether it’s blocked by a firewall. In plain HTML you would load the image like this <img src=”/maybe.png” /> then look for the browser’s broken-image indicator visually. You can do this… Read more →