firefox: Thu Oct 6 02:50:00 2005

Thu Oct 6 02:50:00 2005

Working through, planning to clone everything I had with applescript and Safari.

Looks like window-logging can be done with onOpen/onClose (or is onOpen implicit? given butler, it probably is) and xmlhttprequest...

ooh, since we're firefox-specific, we can use data: urls...

window.addEventListener("load", ...) can be used to run once pageload completes


"click" event - event.stopPropagation(), event.preventDefault() (too raw?)

    method: 'GET',
    url: '<',>
    headers: {
        'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3',
        'Accept': 'application/atom+xml,application/xml,text/xml',
    data: '...',
    onload: function(responseDetails) {
        var parser = new DOMParser();
        var dom = parser.parseFromString(responseDetails.responseText,
        var entries = dom.getElementsByTagName('entry');
        var title;
        for (var i = 0; i < entries.length; i++) {
            title = entries[i].getElementsByTagName('title')[0].textContent;

-- like xmlhtprequest, but it isn't domain-restricted!

comics: add a fetch-next-comic-and-redirect-then-insert-myself button? [use zoomtextarea createButton? ]

document.evaluate("//text()", document, ...) - gets all text nodes, useful for search-and-replace - but is it right for getting snapshots?

GM_setvalue, GM_getvalue - script+user specific - so probably not helpful

GM_registerMenuCommand - tools->user script commands-> ... might do, for snapshot this

"Hide Google Redirects" reprograms Google Personal Search History to use normal <a href="..."> links, but still track clicks by calling GM_xmlhttpRequest on the appropriate tracking URL.

Use to take the prototypes and extend them - add menu items everywhere, etc.

GeoTagThisPage: figure out if getting text nodes helps write values back, using offset mode... or use

paras = document.getElementsByTagName("p")
append paras[n].innerHtml

and unpack later...

  txt = document.evaluate("//text()", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null)
  [object XPathResult]
  # but use XPathResult.ORDERED_NODE_SNAPSHOT_TYPE instead!
  This is my personal collection of Chocolate-related books, including cookbooks, texts, and other books on the subject.
  actually changed the page!

useful trick:

params = [ "foo=bar", "baz=3" ];