Select a tab in Firefox from command line -


firefox lets open new urls command line. there way select existing tab command line, title or url?

yes, there is:

  • install mozrepl addon
  • start it: tools -> mozrepl -> start
  • use telnet connect running mozrepl instance:

    $ telnet 127.0.0.1 4242 

    you can use rlwrap enable readline-like keybindings inside telnet session:

    $ rlwrap telnet 127.0.0.1 4242 
  • define function searching tab given url , switching it. 1 https://github.com/emacsmirror/cedet/blob/master/lisp/cedet/semantic/db-mozrepl.el pretty cool:

    function semanticselecttab(url) {      var numtabs=gbrowser.browsers.length;      for(i=0; i<numtabs-1; i++) {        if(gbrowser.browsers[i].contentdocument.location.href.indexof(url)>=0) {          gbrowser.tabcontainer.selectedindex=i;          break;        }      }    } 
  • run this:

    repl> semanticselecttab("https://stackoverflow.com/questions/31055148/select-a-tab-in-firefox-from-command-line") 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -