I found the firefox extension Firegesture is very useful. You can self-define the function of your gestures.
The following are my scripts:
- Sina Weibo(DUDU)
var sel = 'http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(window.content.location.href)+'&source=bookmark'; gBrowser.loadOneTab(sel, { inBackground: true, relatedToCurrent: true });
- iciba(RLR)
var word = getBrowserSelection(); if (!word) return; var sel = 'http://www.iciba.com/'+encodeURIComponent(word); gBrowser.loadOneTab(sel, { inBackground: true, relatedToCurrent: true });
- Copy the title and url
const AS_HTML = false;
function htmlEscape(s) {
s = s.replace(/&/g, “&”);
s = s.replace(/>/g, “>”);
s = s.replace(/</g, “<”);
s = s.replace(/“/g, “"”);
return s;
}
var url = window.content.location.href;
var title = window.content.document.title;
var txt = AS_HTML ?
‘‘ + htmlEscape(title) + ‘‘ :
title + “\n” + url;
var clipboard = Cc[“@mozilla.org/widget/clipboardhelper;1”]
.getService(Ci.nsIClipboardHelper);
clipboard.copyString(txt);