Hi all,

I just installed conkeror .29 after not using it for a while and was
pleasantly surprised that the -remote options are now functioning.
This was probably the major blocker for me to switch over from regular
firefox.

I was looking for a list-buffers command and noticed that there was a
simple function provided, currently unbound.  I thought I'd try
extending it a bit to allow selecting a buffer, so did a bit of
cuttypaste from the existing list_buffers and plonked the following
into my .conkerorrc:

---------8<-----------
function my_list_all_buffers()
{
    var doc = _content.content.document;
    var browsers = getBrowser().mBrowsers;
    var title;
    var spec;
    doc.write("<H1>Buffer List</H1><HR>");
    doc.write("<TABLE>");
    doc.write("<TR><TH>Title</TH><TH>URL</TH></TR>");
    for (var i=0;i<browsers.length; i++) {
        title = browsers[i].contentTitle || "*untitled*";
        spec = browsers[i].webNavigation.currentURI.spec;
        // rather than browser_next we'll eventually call switch-to-buffer
        doc.write("<TR><TD>" + title + "</TD><TD><A 
onclick=\"browser_next();return false;\" href=\"" + spec + "\">" + spec + 
"</A></TD></TR>");
    }
    doc.write("</TABLE>");
}
function my_list_buffers()
{
    getWebNavigation().loadURI("about:blank", nsIWebNavigation.LOAD_FLAGS_NONE, 
null, null, null);
    // There should be a better way, but I don't know what it is. [comment from 
original list_buffers]
    setTimeout(my_list_all_buffers,0);
}
add_command("my-list-buffers", my_list_buffers, []);
define_key(ctrlx_kmap, make_key("b", MOD_CTRL), "my-list-buffers");
---------8<-----------

When I give it a try there are the following problems:

* When the command runs, the pointer stays as an hourglass (this
  happens with the original list-buffers too).

* The browser_next function I've currently plugged in doesn't get
  called. If I use a javascript alert that works fine.  I assume this
  means the conkeror javascript functions are not visible via this
  document writing mechanism.  How do I make them available?

As you can guess, I've not done javascript before, so hopefully
someone can point out the (probably trivial) error of my ways.

I've also noticed as a general conkeror bug that switching buffers
doesn't update the window title.

And a question: Is it currently possible to open a link in a
new buffer without also switching to it? (The equivalent of middle
clicking a firefox link and having it load in a new tab in the
background).

Cheers,
Len.
_______________________________________________
Conkeror mailing list
[email protected]
http://mozdev.org/mailman/listinfo/conkeror

Reply via email to