Live data from Hacker News

Turn your browser into a notepad with one line

coderwall.com

11–20 of 186 posts

Re: Turn your browser into a notepad with one line

#15

Nifty trick. To build on this, if you use chrome, add it as a search engine with a special keyword so you can type in your URL bar something like "note + + " then you're in typing mode.

In fact, if you add the `%s` variable inside the HTML tag:

    data:text/html, %s
This way, you can enter:

    note [tab] "foo bar baz" [enter]
And whatever you enter as the search query ends up in the note to start with.

Edit: Just saw the other response to this comment saying basically the same thing. Nevermind.

Re: Turn your browser into a notepad with one line

#18
post #6

Now I just need some javascript to listen for Ctrl+S and save it as a text file in ~/Documents/scratchpads. Time to get crackin'

How do you save stuff in files from the browser?

I've googled around about this a couple times and not found anything good, so if anyone can point to some clear documentation I'd appreciate it.

Re: Turn your browser into a notepad with one line

#19
For even more fun, turn your notepad into an interactive JavaScript environment:

  data:text/html, 
Then you can upgrade it by pasting in something like this:

  this.onkeyup = function () {
    this.style.backgroundColor = 'white';
    try {
      eval(this.innerText);
    } catch (e) {
     this.style.backgroundColor = '#FFAAAA';
    } 
  }
Post reply on HN