designMode
Every once in a while I stumble upon an API or browser setting that I can't believe ever existed. Such examples can be seen in the numerous String.prototype
properties such as bold
, italics
, and even blink
, which wrap given string text in their representative HTML tags. Bizarre.
It was recently brought to my attention the document.designMode
API: an on|off
switch that acts almost like a contentEdible
attribute for the entire document. You can toggle designMode
by simply changing the setting:
document.designMode = "on";
With the designMode
setting on, you can edit page text, drag and drop assets, and generally cause chaos on the page. This is really nice for prototyping; I'd have loved to have known about this while doing client work.
While I see uses for this API, it does feel a bit bizarre. I'd have liked to have known the origins of this property and its use cases. Have ideas about how you'd use it? Share!
Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn't been available within CSS. What we end up doing is repeating the same properties multiple times with each browser prefix. Yuck. Another thing we...
Regardless of your stance on pornography, it would be impossible to deny the massive impact the adult website industry has had on pushing the web forward. From pushing the browser's video limits to pushing ads through WebSocket so ad blockers don't detect them, you have...
I'm going to share something with you that will blow your mind: I don't have the MooTools documentation memorized. I just don't. I visit the MooTools docs frequently to figure out the order of parameters of More classes and how best to use...
A long time back I coded a MooTools class called OpenLinks. The class is quite useful but the code...sucks. I've gotten much better with MooTools over the past years so I thought I'd go back and update the class to be better, faster...
Hi David,
thanks for the trigger!
We digged deeper and unveiled the origin: https://twitter.com/slicknet/status/1180862121371811840
That was fun :-D