浏览器变成记事本

January 30, 2013

刚才在微博上看到一招,把浏览器变成笔记本。

先来个原文的链接吧。https://coderwall.com/p/lhsrcq

原文如下:

Introduction介绍

Sometimes I just need to type garbage(垃圾). Just to clear out my mind. Using editors to type such gibberish(快而不清的话) annoys (使烦恼)me because it clutters(弄乱) my project workspace (I'm picky(挑剔的), I know).

So I do this. Since I live in the browser, I just open a new tab and type in the url tab.

data:text/html, <html contenteditable>

Voila, browser notepad.

Why it works?

You don't need to remember it. It's not rocket science(科学). We are using the Data URI's format and telling the browser to render(给予) an html (try "javascript:alert('Bazinga');"). The content of said html is a simple html line with the html5 attribute(属性) contenteditable. This works only on modern browsers that understand this attribute. Click and type!

--- EOF ---

添加新评论