get annotation from firefox

Most of the time I use Firefox to visit my ticket system and making a task there is not as easy as in w3m.

Here’s how my way of getting the annotation improves:

  • At the very beginning I just copy the URL from Firefox and paste to w3m-browse-url, and make annotation there. This is not very convience, and my CVS version of w3m-mode hangs my CVS Emacs often.
  • I use the copyurlplus extention to get the annotation. To do that, I’ll need to add
user_pref("copyurlplus.menus.2.copy", "[[%URL%][%TITLE%]]");
user_pref("copyurlplus.menus.2.label", "Copy as planner anno");

to my prefs.js. (change the “2″ to “1″ if you haven’t customize copy URL Plus before.) However, to get the annotation, I need to right click on the page and choose the menu item. This is, of cause, not convience for a keyboard user like me.

  • And here’s what I’ve figured out today, using key config. By adding these:
user_pref("keyconfig.main.xxx_key__ddliu_copy_as_planner_anno", "alt][C][][function ddliu_CopyClipboard(text) {\nvar gClipboardHelper = Components.classes[\"@mozilla.org/widget/clipboardhelper;1\"].getService(Components.interfaces.nsIClipboardHelper);\ngClipboardHelper.copyString(text);\n}\nvar myURL= window._content.location.href;\nvar myTitle = window._content.document.title;\n\nvar copytext = \"[[\" + myURL + \"]\" + \"[\" + myTitle + \"]]\";\nddliu_CopyClipboard(copytext);\n][");

Into my prefs.js, I can get the annotation by just press Alt-c.

The life rocks :)

Tags: , ,

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

Close
E-mail It