Skip to content
All projects

Browser extension

Surround it!

Select text, type a bracket, and the text ends up inside it instead of being replaced. What every code editor does, in every input on any page. Editors have had the habit for twenty years and no browser does it anywhere else; this teaches it to Chrome, Edge and Firefox.

JavaScriptChromeFirefoxEdge

Every code editor written in the last twenty years does this. Highlight a word, press (, and the word is wrapped in brackets. Leave that editor for a comment box, a search field or any other input on the open web, and the same keystroke deletes what you selected.

The muscle memory does not care which window it is in, so I kept destroying text I meant to wrap. This extension makes the browser behave the way the editor does, in every input, text area and editable element on any page. Brackets, single quotes, double quotes and backticks are handled out of the box, the selection survives the operation, and you can configure a character pair of your own.

It began as an experiment in whether I could write a browser extension at all. It turned out to work well enough on the first attempt that it now runs on all three major engines from a single codebase.