Hi,

what I'm missing on the classic interface of gmane is the possibility to
jump to the next or previous article with browser-object-relationship-*.
Hence, I've created the hook below to mark the appropriate links.

Unfortunaly, the frame_iterator doesn't work as I've expected it and the
other code looks a little bit strange. How can it be done niftier?

add_hook("buffer_loaded_hook",
  function (buffer)
  {
      if (! buffer instanceof content_buffer)
          return;

      if (/\/\/thread\.gmane\.org/.test(buffer.display_uri_string))
      {
          for (let frame in frame_iterator(buffer.top_frame))
          {
              frame = buffer.top_frame.frames[0]
              if (frame.name != 'threads')
                  continue;
              // Cleanup after the inner frame was loaded
              for each (let l in frame.document.getElementsByTagName("a"))
                  l.rel = "";
              let el = frame.document.getElementsByClassName("focused")[0];
              if (! el)
                  continue;
              let link;
              if (el.nextElementSibling)
              {
                  link = el.nextElementSibling.getElementsByTagName("a")[0];
                  if (link)
                      link.rel = "next";
              }
              if (el.previousElementSibling)
              {
                  link = el.previousElementSibling.getElementsByTagName("a")[0];
                  if (link)
                      link.rel = "prev";
              }
          }
      }
  });

Thanks for your help, Jörg.
-- 
Die Katze steht im Mittelpunkt unserer Arbeit.
Alles was wir tun, ist für sie.
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to