{
  "attachments": [],
  "comments_archived": true,
  "date": "2005-06-08T20:47:56.000Z",
  "layout": "post",
  "title": "Further quick thoughts on GreaseMonkey",
  "wordpress_id": 646,
  "wordpress_slug": "further-greasemonkey",
  "wordpress_url": "http://www.decafbad.com/blog/?p=646",
  "year": "2005",
  "month": "06",
  "day": "08",
  "isDir": false,
  "slug": "further-greasemonkey",
  "type": "entry",
  "postName": "2005-06-08-further-greasemonkey",
  "html": "<p>Now for some quick GreaseMonkey spew, recorded without any effort to actually see what's up in the community or reading any FAQs:</p>\n<ul>\n<li>I want to separate script code into reusable modules.</li>\n<li>That said, am I an <a href=\"http://www.joelonsoftware.com/articles/fog0000000018.html\">Architecture Astronaut</a> when I can't get more than 10 minutes into a quick project without already starting to digress into building a <em>reusable framework</em>?</li>\n<li>Is it wrong that I felt like I was working in Perl again when I wrote <a href=\"http://www.decafbad.com/2005/06/magic_hcalendar.user.js\">that script</a>?</li>\n<li>That said, I wish JavaScript had either multi-line quotes ala Python or Perl heredoc syntax.</li>\n<li>Doing some twisty regex search-and-replace in Vi lets you do a lot of refactoring / recoding damage to source code in no time flat.</li>\n<li>Can I just say how nice it is to not worry about other browsers when coding?</li>\n</ul>\n<p>I've also got a few ideas I'd like to record and pursue for future GreaseMonkey endeavors:</p>\n<ul>\n<li>Record the URL of all form submissions via XMLHTTPRequest to a remote server, with blog comment forms in mind.  Track changes on those URLs.  Notify me via Atom feed when new comments arrive in places where I posted comments.</li>\n<li>Clean up and abstract that magic form thing I did into a more general way to make all kinds of magic textarea forms.  (More microformats?  .sig files for LiveJournal responses?  /usr/bin/banner for annoying blog comments?)</li>\n<li>Revive <a href=\"http://wired-vig.wired.com/news/business/0,1367,42803,00.html\">Third Voice</a> in GreaseMonkey style.  Subscribe to arbitrary REST API'ed annotation servers, fetch &amp; aggregate annotations for current URL via XMLHTTPRequest, build cute floating stickies with rude comments from friends.</li>\n<li>Auto-ROT13 en/decoder ring, because there's a need for that.</li>\n<li>Script which redirects all links to books on Amazon.com to point at my new book.  I will install this on all computers at CompUSA and the Apple Store.</li>\n</ul>\n<p>I've suddenly realized that a lot of the things I wanted to do with <a href=\"http://www.decafbad.com/twiki/bin/view/Main/AgentFrank\">Agent Frank</a> are possible with GreaseMonkey.  Also, I wonder how long it'll be before I get sucked into further FireFox extension hacking.</p>\n<!--more-->\n\n\n<p>shortname=further_greasemonkey</p>\n<div id=\"comments\" class=\"comments archived-comments\"><h3>Archived Comments</h3>\n<ul class=\"comments\">\n<li class=\"comment\" id=\"comment-221090330\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=f3794e603ef53b0513ab45b6565ee457&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"\">Jeremy Dunck</a>\n</div>\n\n\n<p><a href=\"#comment-221090330\" class=\"permalink\"><time datetime=\"2005-06-08T18:00:08\">2005-06-08T18:00:08</time></a></p>\n</div>\n\n\n<div class=\"content\">Regarding reusable framework.. Dood, think shell scripts for the web.\nAlso, if you want dependency management, you're likely to have better luck creating an extension, like jslib (http://jslib.mozdev.org/ ).\nOn Third Voice bit, Simon Willison and Aaron Boodman are both tinkering in this area.\nOn decoder ring, you mean where 2 users would share a key, or do u mean persisting encoded values?  \nOn book redirect... too evil. ;)</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090332\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=8a5273f79cfe7579ad46023f93377aa8&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"\">l.m. orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221090332\" class=\"permalink\"><time datetime=\"2005-06-08T19:02:36\">2005-06-08T19:02:36</time></a></p>\n</div>\n\n\n<div class=\"content\">Jeremy: Hey, I've been known to amass large libraries of functions for shell scripts too.  :)  But that's not so much a framework as a module, which is what I was really doing.  But I suspect I will start getting sucked into actual extension development.\nAs for the decoder ring, I was really just thinking of something silly with ROT13 for spoilers to movies &amp; etc... but a shared key secret spy ring would be nifty.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090333\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://plasmasturm.org/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=e17949267bbfe21a0fadf1bbf00592b4&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://plasmasturm.org/\">Aristotle Pagaltzis</a>\n</div>\n\n\n<p><a href=\"#comment-221090333\" class=\"permalink\"><time datetime=\"2005-06-09T00:13:08\">2005-06-09T00:13:08</time></a></p>\n</div>\n\n\n<div class=\"content\">Check out the [JSAN howto/proposal](http://use.perl.org/~schwern/journal/24112).\nThat is *big* stuff right there. I've seen a few other posts by other people since that one was written which indicate that there's motion. Not much of it seems visible yet though.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090336\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.joegrossberg.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=21fa249406e02cd506f422727b4351aa&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.joegrossberg.com\">Joe Grossberg</a>\n</div>\n\n\n<p><a href=\"#comment-221090336\" class=\"permalink\"><time datetime=\"2005-06-09T11:28:25\">2005-06-09T11:28:25</time></a></p>\n</div>\n\n\n<div class=\"content\">\"Can I just say how nice it is to not worry about other browsers when coding?\"\nIt's like the *moral* way to experience that thrill.\nPlus, it's simpler than an Extension (never underestimate the major impact of making something slightly easier) and you get to apply it to someone else's site.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090337\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://philringnalda.com/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=e68e9944f50a481a64b5a32fdfc02e0d&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://philringnalda.com/\">Phil Ringnalda</a>\n</div>\n\n\n<p><a href=\"#comment-221090337\" class=\"permalink\"><time datetime=\"2005-06-12T01:24:59\">2005-06-12T01:24:59</time></a></p>\n</div>\n\n\n<div class=\"content\">Unfortunately, you only really get to enjoy one-browser coding if you are doing a script for yourself; otherwise, you'll have that nagging feeling that you should be careful to keep it usable as an Opera 8 User JavaScript, and as a Trixie  script, and as a Turnabout  script, and ...\nExtensions, though, you're really single browser (or slightly more, if you support Seamonkey too), and with chrome privileges you can do whatever you want.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090338\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=f3794e603ef53b0513ab45b6565ee457&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"\">Jeremy Dunck</a>\n</div>\n\n\n<p><a href=\"#comment-221090338\" class=\"permalink\"><time datetime=\"2005-06-12T17:35:24\">2005-06-12T17:35:24</time></a></p>\n</div>\n\n\n<div class=\"content\">I've said it before, and I'll say again: I think single-browser user scripts are not the evil that single-browser sites are.  The browser user is in control of their browser and their user scripts.  They can port a script meant for another browser if they like.  The script author does not owe that consideration.\nOf course, do it where it makes sense and isn't painful...</div>\n\n\n</li>\n</ul>\n\n\n</div>\n\n\n",
  "body": "Now for some quick GreaseMonkey spew, recorded without any effort to actually see what's up in the community or reading any FAQs:\r\n\r\n* I want to separate script code into reusable modules.\r\n* That said, am I an [Architecture Astronaut][astro] when I can't get more than 10 minutes into a quick project without already starting to digress into building a *reusable framework*?\r\n* Is it wrong that I felt like I was working in Perl again when I wrote [that script][script]?\r\n* That said, I wish JavaScript had either multi-line quotes ala Python or Perl heredoc syntax.\r\n* Doing some twisty regex search-and-replace in Vi lets you do a lot of refactoring / recoding damage to source code in no time flat.\r\n* Can I just say how nice it is to not worry about other browsers when coding?\r\n\r\nI've also got a few ideas I'd like to record and pursue for future GreaseMonkey endeavors:\r\n\r\n* Record the URL of all form submissions via XMLHTTPRequest to a remote server, with blog comment forms in mind.  Track changes on those URLs.  Notify me via Atom feed when new comments arrive in places where I posted comments.\r\n* Clean up and abstract that magic form thing I did into a more general way to make all kinds of magic textarea forms.  (More microformats?  .sig files for LiveJournal responses?  /usr/bin/banner for annoying blog comments?)\r\n* Revive [Third Voice][tvoice] in GreaseMonkey style.  Subscribe to arbitrary REST API'ed annotation servers, fetch & aggregate annotations for current URL via XMLHTTPRequest, build cute floating stickies with rude comments from friends.\r\n* Auto-ROT13 en/decoder ring, because there's a need for that.\r\n* Script which redirects all links to books on Amazon.com to point at my new book.  I will install this on all computers at CompUSA and the Apple Store.\r\n\r\nI've suddenly realized that a lot of the things I wanted to do with [Agent Frank][afrank] are possible with GreaseMonkey.  Also, I wonder how long it'll be before I get sucked into further FireFox extension hacking.\r\n\r\n[afrank]: http://www.decafbad.com/twiki/bin/view/Main/AgentFrank\r\n[tvoice]: http://wired-vig.wired.com/news/business/0,1367,42803,00.html\r\n[astro]: http://www.joelonsoftware.com/articles/fog0000000018.html\r\n[script]: http://www.decafbad.com/2005/06/magic_hcalendar.user.js\r\n<!--more-->\r\nshortname=further_greasemonkey\r\n\r\n<div id=\"comments\" class=\"comments archived-comments\">\r\n            <h3>Archived Comments</h3>\r\n            \r\n        <ul class=\"comments\">\r\n            \r\n        <li class=\"comment\" id=\"comment-221090330\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=f3794e603ef53b0513ab45b6565ee457&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"\">Jeremy Dunck</a>\r\n                </div>\r\n                <a href=\"#comment-221090330\" class=\"permalink\"><time datetime=\"2005-06-08T18:00:08\">2005-06-08T18:00:08</time></a>\r\n            </div>\r\n            <div class=\"content\">Regarding reusable framework.. Dood, think shell scripts for the web.\r\n\r\nAlso, if you want dependency management, you're likely to have better luck creating an extension, like jslib (http://jslib.mozdev.org/ ).\r\n\r\nOn Third Voice bit, Simon Willison and Aaron Boodman are both tinkering in this area.\r\n\r\nOn decoder ring, you mean where 2 users would share a key, or do u mean persisting encoded values?  \r\n\r\nOn book redirect... too evil. ;)</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090332\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=8a5273f79cfe7579ad46023f93377aa8&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"\">l.m. orchard</a>\r\n                </div>\r\n                <a href=\"#comment-221090332\" class=\"permalink\"><time datetime=\"2005-06-08T19:02:36\">2005-06-08T19:02:36</time></a>\r\n            </div>\r\n            <div class=\"content\">Jeremy: Hey, I've been known to amass large libraries of functions for shell scripts too.  :)  But that's not so much a framework as a module, which is what I was really doing.  But I suspect I will start getting sucked into actual extension development.\r\n\r\nAs for the decoder ring, I was really just thinking of something silly with ROT13 for spoilers to movies & etc... but a shared key secret spy ring would be nifty.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090333\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://plasmasturm.org/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=e17949267bbfe21a0fadf1bbf00592b4&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://plasmasturm.org/\">Aristotle Pagaltzis</a>\r\n                </div>\r\n                <a href=\"#comment-221090333\" class=\"permalink\"><time datetime=\"2005-06-09T00:13:08\">2005-06-09T00:13:08</time></a>\r\n            </div>\r\n            <div class=\"content\">Check out the [JSAN howto/proposal](http://use.perl.org/~schwern/journal/24112).\r\n\r\nThat is *big* stuff right there. I've seen a few other posts by other people since that one was written which indicate that there's motion. Not much of it seems visible yet though.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090336\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.joegrossberg.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=21fa249406e02cd506f422727b4351aa&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.joegrossberg.com\">Joe Grossberg</a>\r\n                </div>\r\n                <a href=\"#comment-221090336\" class=\"permalink\"><time datetime=\"2005-06-09T11:28:25\">2005-06-09T11:28:25</time></a>\r\n            </div>\r\n            <div class=\"content\">\"Can I just say how nice it is to not worry about other browsers when coding?\"\r\n\r\nIt's like the *moral* way to experience that thrill.\r\n\r\nPlus, it's simpler than an Extension (never underestimate the major impact of making something slightly easier) and you get to apply it to someone else's site.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090337\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://philringnalda.com/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=e68e9944f50a481a64b5a32fdfc02e0d&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://philringnalda.com/\">Phil Ringnalda</a>\r\n                </div>\r\n                <a href=\"#comment-221090337\" class=\"permalink\"><time datetime=\"2005-06-12T01:24:59\">2005-06-12T01:24:59</time></a>\r\n            </div>\r\n            <div class=\"content\">Unfortunately, you only really get to enjoy one-browser coding if you are doing a script for yourself; otherwise, you'll have that nagging feeling that you should be careful to keep it usable as an Opera 8 User JavaScript, and as a Trixie  script, and as a Turnabout  script, and ...\r\n\r\nExtensions, though, you're really single browser (or slightly more, if you support Seamonkey too), and with chrome privileges you can do whatever you want.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090338\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=f3794e603ef53b0513ab45b6565ee457&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"\">Jeremy Dunck</a>\r\n                </div>\r\n                <a href=\"#comment-221090338\" class=\"permalink\"><time datetime=\"2005-06-12T17:35:24\">2005-06-12T17:35:24</time></a>\r\n            </div>\r\n            <div class=\"content\">I've said it before, and I'll say again: I think single-browser user scripts are not the evil that single-browser sites are.  The browser user is in control of their browser and their user scripts.  They can port a script meant for another browser if they like.  The script author does not owe that consideration.\r\n\r\nOf course, do it where it makes sense and isn't painful...</div>\r\n            \r\n        </li>\r\n    \r\n        </ul>\r\n    \r\n        </div>\r\n    ",
  "parentPath": "./content/posts/archives/2005",
  "path": "2005/06/08/further-greasemonkey",
  "summary": "Now for some quick GreaseMonkey spew, recorded without any effort to actually see what's up in the community or reading any FAQs:\n\nI want to separate script code into reusable modules.\nThat said, am I an Architecture Astronaut when I can't get more than 10 minutes into a quick project without already starting to digress into building a reusable framework?\nIs it wrong that I felt like I was working in Perl again when I wrote that script?\nThat said, I wish JavaScript had either multi-line quotes ala Python or Perl heredoc syntax.\nDoing some twisty regex search-and-replace in Vi lets you do a lot of refactoring / recoding damage to source code in no time flat.\nCan I just say how nice it is to not worry about other browsers when coding?\n\nI've also got a few ideas I'd like to record and pursue for future GreaseMonkey endeavors:\n\nRecord the URL of all form submissions via XMLHTTPRequest to a remote server, with blog comment forms in mind.  Track changes on those URLs.  Notify me via Atom feed when new comments arrive in places where I posted comments.\nClean up and abstract that magic form thing I did into a more general way to make all kinds of magic textarea forms.  (More microformats?  .sig files for LiveJournal responses?  /usr/bin/banner for annoying blog comments?)\nRevive Third Voice in GreaseMonkey style.  Subscribe to arbitrary REST API'ed annotation servers, fetch & aggregate annotations for current URL via XMLHTTPRequest, build cute floating stickies with rude comments from friends.\nAuto-ROT13 en/decoder ring, because there's a need for that.\nScript which redirects all links to books on Amazon.com to point at my new book.  I will install this on all computers at CompUSA and the Apple Store.\n\nI've suddenly realized that a lot of the things I wanted to do with Agent Frank are possible with GreaseMonkey.  Also, I wonder how long it'll be before I get sucked into further FireFox extension hacking.",
  "needsBuild": true,
  "prevPostPath": "2005/06/08/greasemonkey-magic",
  "prevPostTitle": "Magic Microformat Forms Redux, Now with GreaseMonkey!",
  "nextPostPath": "2005/06/08/back-to-the-quickies",
  "nextPostTitle": "Back to the Quickies"
}