0%

Firefox extension FireGesture Scripts

I found the firefox extension Firegesture is very useful. You can self-define the function of your gestures.

The following are my scripts:

  1. 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 });
  2. iciba(RLR) var word = getBrowserSelection(); if (!word) return; var sel = 'http://www.iciba.com/'+encodeURIComponent(word); gBrowser.loadOneTab(sel, { inBackground: true, relatedToCurrent: true });
  3. 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);

感谢您的鼓励和打赏!