theme selector

light blue screenshot grey screenshot navy screenshot dark green screenshot red and black screenshot

by Tony Chang

All opinions on this site are my own and do not represent those of my employer.

Creative Commons Attribution License

gm + webnote

Apr 14, 2005, 12:58am EDT



I said I was going to do it. I turned webnote into a Greasemonkey script. With the webnote gm user script, you can add notes to any web page. If you save the notes, they’ll be there the next time you browse to the page. They can also be viewed by anyone.

To create a new note, press alt+n. To save all notes, press alt+s. As of revision 1.11, saving happens automatically.

This is very, very early. There are lots of usability problems (knowing what pages have notes, remembering to save), collaboration problems (overwriting notes, keeping track of changes), and scale problems (hits my server for every page you load). But you know what they say: release early, release often.

This took an hour or so over the past few nights to complete. About an hour getting the webnote code running in Greasemonkey, an hour copying/modifying the existing webnote backend, then a couple hours adding saving/loading with the new backend. Ah, the magic of closures.

Note about privacy: The script sends a request to a central server that checks for notes on that page. That is, I can see all pages you visit, although they’re just associated with an IP address. If you want to avoid doing that for certain sites, add it to the greasemonkey exclude list. TODO: use a hash of the url and try to remove/spoof the referer header. Fixed, please upgrade.

Update 2: I’m an idiot. Permalink to the entry fixed.

Update 3: Current version and notes can be found on this page.

Julien Couvreur at Apr 15, 2005, 02:42pm EDT

Got your webnote user script from the GM mailinglist, but couldn’t get it to work. Ctrl-Alt-n doesn’t do anything here :( I haven’t gone into the script to analyze what is going on yet. Any ideas? Note: I don’t have any errors in the javascript console..

tony at Apr 15, 2005, 03:32pm EDT

No errors in the JS console? Hmmm, what version of greasemonkey are you using? 0.2.6 or newer should be fine …

Jeremy Dunck at Apr 15, 2005, 05:36pm EDT

I’m running 0.3a, a test version from the GM mailing list.

I got the “Congratulations” install note, but can’t create others.

Additionally, when I delete that note, it disappears on that page view, but reappears on the subsequent page view.

Jeremy Dunck at Apr 15, 2005, 05:54pm EDT

OK, I did some testing with dump, and it seems that the keydown event is never getting the combination of ctrl+alt+n. I seem to be getting a separate event per key (including ctrl and alt), but when I hit N, the other flags are false.

Added in document.addEventListener(‘keydown’…: dump(‘kp alt: ‘ + ev.altKey + ‘, ctrl: ‘ + ev.ctrlKey + ‘ key: ‘ + ev.keyCode + ‘ ’);

and the results:

kp alt: false, ctrl: true //when I pressed Ctrl key: 17 kp alt: false, ctrl: false //when I pressed Alt key: 18 kp alt: false, ctrl: false //when I pressed N key: 78 Which is a bit surprising…

Christophe at Apr 15, 2005, 05:40pm EDT

What OS are you using Tony? I had the same problem as Julien. I am running XP . I have modified your js to save and create on alt+S and alt+N and it works fine now…

Thanks for this great application of webnote!

BTW I am looking for a job in the SF bay area. If you know of a great and innovative company who needs a Software Eng. let me know! chrisbaub71-webnote At

tony at Apr 15, 2005, 05:59pm EDT

Wow, you’re right, ctrl+alt doesn’t work in Windows. I’ve updated the script to only require alt+n or alt+s. I’ll probably change this to not require any key presses to save and add a menu item for new notes.

I had only tested it in FreeBSD and linux.

Scott at Apr 16, 2005, 03:38pm EDT

I’ve go Firefox 1.0.3, GM 0.2.6, Win XP. I installed your script and nothing seems to happen when I try alt+n. Do I need to alter your script in some way to open the workspace I created on the webnote page?


Scott at Apr 17, 2005, 03:12am EDT

I must have messed something up. Got it working now.Thanks

Dave Lovely at Apr 16, 2005, 04:09pm EDT

Just to let you know that alt+s opens the Sage feedreader in the sidebar in Firefox, - otherwise, good script, works fine with GM 0.3 in Widows XP.

Scott at Apr 17, 2005, 03:28am EDT

alt+s does open the Sage sidebar but it does also appear that the note gets saved. Deleting a note didn’t appear too intuitive…Click the X to destroy the note and make sure you save again.

tony at Apr 17, 2005, 05:16pm EDT

Agreed. I’ve updated the script to automatically save if you’ve changed the notes (created a new note, deleted a note, change the text, or moved a note).

Scott at Apr 17, 2005, 10:39pm EDT

Cool. Except I installed it and I’m getting “500 Internal Server Error”. Seems to occur at the time the note is trying to be saved.

tony at Apr 17, 2005, 11:29pm EDT

Grr, I should be more careful when moving around lots of files.

Scott at Apr 18, 2005, 12:07am EDT

Looks fixed now.

Chris at Apr 17, 2005, 08:12pm EDT


Are the changes you made to the webnote server available on CVS yet?


tony at Apr 17, 2005, 08:52pm EDT

Ok, I’ve added it.

Actually, I should just re-write the whole thing and consolidate it into a single backend.

hey at Apr 30, 2005, 12:47pm EDT

Hello sir, Is it possible to add webnote owner login ? So that if i use webnote just like a guestbook, to let other post note and i edit to reply them. No one can act as the webnote owner to reply. Thanks

tony at Apr 30, 2005, 02:11pm EDT

To the greasemonkey version or to the general version? In both cases, not right now. The regular webnote probably won’t ever have authentication. See the FAQ for an explanation.

hey at May 01, 2005, 05:44am EDT

ya. Thanks for your quick reply. I have read the fAQ before. For the first reason I am not sounderstand,as i’m not a programmer. Just hope you will add it in future.

hey at May 01, 2005, 03:29pm EDT

Also, if able to move existing note (not just new note). It will more excellent.

tony at May 01, 2005, 05:39pm EDT

You should be able to move/edit/delete existing notes …

Lorenzo at May 03, 2005, 01:32pm EDT

Tony - I’ve not had much luck getting the script (on Update #3) to save new or modified notes, it just tells me I need to update the script. I downloaded it and modified the Version # but that didn’t seem to help either. I’m running GM 0.2.6 + XP + FF 1.0.3 Suggestions? I’ve been using you standard webnote for some time and I think this new function would be awesome to incorporate into my urls. Thanks again for your awesome work.

Lorenzo at May 03, 2005, 01:43pm EDT

Sorry - I just upgraded to the latest GM beta and it works fine.

Jeff Schallenberg at May 04, 2005, 07:05am EDT

Thanks to Lorenzo’s experience and feedback, I was able to get webnote_gm.js working. Had to install the Latest Beta release 0.3 of GM. With the Stable Release 0.2.6, webnote_gm would not save notes - the file-save animated icon would spin for a while, then a JavaScript Application Error window would pop up, telling me to upgrade the webnote_gm SCRIPT to the latest version!

AOK now… Off to test it on a few sites!


Volker Eichhorn at May 06, 2005, 04:44pm EDT

Hi Toni,

i just discoverd this script and its awesome!


Nemoflow at May 13, 2005, 10:13am EDT

Great Script…thanks! :) One Question:

How and where exactly can I change the colors and Fonts of Stickys? This glossy Yellow does not please me.

tony at May 13, 2005, 01:53pm EDT

You currently can’t change the color of the note. You can, however, put some html into a note. For example, you could add a span tag to set the font type.

Clay at May 26, 2005, 07:24am EDT

Actually, you can change the color of the note by editing the script itself. I won’t get into the details of how to edit scripts, but if you figure that out, then just do a text-search in the script for “note.bgcolor.” You’ll find it eventually.

Leandro Ardissone at Jun 22, 2005, 07:45pm EDT

Excellent dude!

It’s a great tool!

molgar at Jul 18, 2005, 07:48pm EDT

Lovely script.

Just came to say that since GM_xmlhttpRequest poses a serious security threat, the next version GM will have it disabled. This will render this script useless until/unless a solution is found.

Best regards.

tony at Jul 19, 2005, 12:07am EDT

Thanks, I just got caught up with the mailing list. I’ve added a warning and disabled saving.

Fermi at Jul 19, 2005, 08:52pm EDT

Hi, I installed your script of the webnote stuff…but when I create a webnote and click “refresh” it disappears! I don’t know why…

I am running Firefox 1.05 and GM0.35…

tony at Jul 19, 2005, 09:29pm EDT

Please read the upgrade notice.

Greasemonkey 0.3.5 is a “neutered” version that will no longer work with this script. Aaron is working on a fix, but you’ll have to wait until it’s available.

Fermi at Jul 20, 2005, 09:09am EDT

Gosh! I just realized…!

Anyway, thank you for your quick reply Tony! You are so kind to be so patient!

molgar at Jul 20, 2005, 03:22pm EDT

Hey, you might want to add this cool script to

Best regards

Duane at Aug 30, 2005, 12:46am EDT

Hi, I don’t know if this is the right place to ask this if not you can move it, (please after I reply) is it possible for you to make a note that has some examples of syntax in it for noobies like myself that would give a brief overview of things like how to lock a note or create a locked note, change text size and color, add a table and a few other things into a note? I’m not particular if the note page is for the grease monkey end of it, but mainle for thewebnotes part itself. Maybe on the components page you could post a note on how to do things like this if it’s even possible.

tony at Aug 30, 2005, 02:42am EDT

Questions like this should be sent to the mailing group or directly to me.

There are no locked notes. With the greasemonkey script, you only get a subset of HTML (so people don’t hijack cookies). On the regular webnote site, you can use any HTML including tables. I’ve added an example to the components page.

Duane at Aug 30, 2005, 04:28am EDT

Thank you for that

cocaine at Apr 21, 2006, 05:29pm EDT

can not work now?