[Conkeror] numberedlinks filtering

Jeremy Maitin-Shepard jeremy at jeremyms.com
Sun Dec 2 14:42:51 PST 2007


"Mark Eichin" <eichin at gmail.com> writes:

> I've been using conkeror on an EEEpc a bunch lately, which is a
> distinctly underpowered box, so I'd like to have numberedlinks not
> even trigger on some link-heavy pages (which it isn't going to be that
> useful on anyway.)  In particular, hiveminder (task.hm/hiveminder.com)
> which is a *very* link-heavy page - but once I have the hook I might
> as well turn it off for gmail and wunderground (more because it causes
>  layout problems, there.)

> For now I'm using

> saved_numberedlinks_resize = numberedlinks_resize
> function numbered_links_filter(cont) {
>     url = cont.document.commandDispatcher.focusedWindow.location.href;
>     alert("NLF: " + url);
>     if (url.match("hiveminder.com")) { return; }
>     if (url.match("wunderground.com")) { return; }
>     if (url.match("mail.google.com")) { return; }
>     return saved_numberedlinks_resize (cont);
> }

> numberedlinks_resize = numbered_links_filter

> but this isn't working on multiple m-x reinit's; I'd modified
> nl_document_observer instead but that's only one triggering case, not
> all of them.  Is this at least the right approach? Am I just confusing
> javascript too much with other languages and I should patch
> numberedlinks_resize directly in numberedlinks.js?

Probably that is more likely to work.  I've found that attempting to
redefine functions doesn't always have the desired effect.  I think
JavaScript somehow binds the names to the actual function in some cases
sooner, and therefore the redefinition won't work.

I hope to soon (maybe after a few weeks when I have more time) implement
a better numbered links that will be faster and support hooks like this
to disable it in some cases.

In particular, borrowing from vimperator's new link system, the idea is
to only display link numbers after entering a command to start entering
a link identifier, then display all of the numbers floating so that they
don't affect the layout, and only display numbers for the visible links
so that it is fast and the numbers don't get to be too high, and allow
the user to type either the number of the link or some of the text of
the link.

This might make it unnecessary to disable the numbers on certain sites
anyway.

-- 
Jeremy Maitin-Shepard


More information about the Conkeror mailing list