V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hylau
V2EX  ›  分享发现

有感觉前几天 livid 的提问,分享个 firefox/FireGestures 插件的截屏脚本

  •  
  •   hylau · 2014 年 5 月 11 日 · 2477 次点击
    这是一个创建于 4352 天前的主题,其中的信息可能已经有所发展或是发生改变。
    var path = "F:\\Desktop";
    var canvas = content.document.createElement("canvas");
    canvas.width = content.document.body.clientWidth;
    canvas.height = content.document.body.clientHeight;
    var ctx = canvas.getContext("2d");
    ctx.drawWindow(content, 0, 0, canvas.width, canvas.height, "rgb(255,255,255)");
    var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
    file.initWithPath(path + "\\" + new Date().getTime() + ".png");
    Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Components.interfaces.nsIWebBrowserPersist).saveURI(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(canvas.toDataURL(), null, null), null, null, null, null, file, null);
    -----
    F:\\Desktop是所存位置,我设定的是按住鼠标向下,向右向下的手势


    原帖: http://tieba.baidu.com/p/1994076176?pid=26391826918&cid=26392798567#26392798567
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2827 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 11:55 · PVG 19:55 · LAX 04:55 · JFK 07:55
    ♥ Do have faith in what you're doing.