阅读:2382回复:5
求一个扩展(重装了系统有些扩展找不到在哪下载了)
是一个保存网页为图片的扩展,支持中文,在工具栏出一个相机图标,保存时有相机咔一声,保存网页时可选择整个网页,还可选择保存只有眼睛能看到的部分等。感觉它不崩溃,速度快。
|
|
1楼#
发布于:2011-03-05 11:24
直接js代码,加到鼠标手势就行了(可能需要FX4)
var win = window.content; var w = win.document.width; var h = win.document.height; var pos = document.getElementById('status-bar'); var scrollbox = document.createElement('scrollbox'); scrollbox.width = '1'; scrollbox.height = '1'; pos.appendChild(scrollbox); var canvas = win.document.createElement('canvas'); canvas.style.display = 'inline'; canvas.width = w; canvas.height = h; scrollbox.appendChild(canvas); var ctx = canvas.getContext("2d"); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.save(); ctx.scale(1.0, 1.0); ctx.drawWindow(win, 0, 0, w, h, "rgb(255,255,255)"); ctx.restore(); var url = canvas.toDataURL("image/png"); const IO_SERVICE = Components.classes['@mozilla.org/network/io-service;1'] .getService(Components.interfaces.nsIIOService); url = IO_SERVICE.newURI(url, null, null); var fp = Components.classes['@mozilla.org/filepicker;1'] .createInstance(Components.interfaces.nsIFilePicker); fp.init(window, "Save Screenshot As", fp.modeSave); fp.appendFilters(fp.filterImages); fp.defaultExtension = "png"; fp.defaultString = win.document.title + ".png"; if ( fp.show() == fp.returnCancel || !fp.file ) return; var wbp = Components.classes['@mozilla.org/embedding/browser/nsWebBrowserPersist;1'] .createInstance(Components.interfaces.nsIWebBrowserPersist); wbp.saveURI(url, null, null, null, null, fp.file); pos.removeChild(scrollbox); |
|
|
2楼#
发布于:2011-03-05 11:24
Pearl Crescent Page Saver Basic :: Firefox 附加组件
https://addons.mozilla.org/zh-CN/firefox/addon/10367/ |
|
3楼#
发布于:2011-03-05 11:24
cinhoo:直接js代码,加到鼠标手势就行了(可能需要FX4)var win = window.content; var w = win.document.width; var h = win.document.height; var pos = document.getElementById('status-bar'); var scrollbox = document.createElement('scrollbox'); scrollbox.width = '1'; scrollbox.height = '1'; pos.appendChild(scrollbox); var canvas = win.document.createElement('canvas'); canvas.style.display = 'inline'; canvas.width = w; canvas.height = h; scrollbox.appendChild(canvas); var ctx = canvas.getContext("2d"); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.save(); ctx.scale(1.0, 1.0); ctx.drawWindow(win, 0, 0, w, h, "rgb(255,255,255)"); ctx.restore(); var url = canvas.toDataURL("image/png"); const IO_SERVICE = Components.classes['@mozilla.org/network/io-service;1'] .getService(Components.interfaces.nsIIOService); url = IO_SERVICE.newURI(url, null, null); var fp = Components.classes['@mozilla.org/filepicker;1'] .createInstance(Components.interfaces.nsIFilePicker); fp.init(window, "Save Screenshot As", fp.modeSave); fp.appendFilters(fp.filterImages); fp.defaultExtension = "png"; fp.defaultString = win.document.title + ".png"; if ( fp.show() == fp.returnCancel || !fp.file ) return; var wbp = Components.classes['@mozilla.org/embedding/browser/nsWebBrowserPersist;1'] .createInstance(Components.interfaces.nsIWebBrowserPersist); wbp.saveURI(url, null, null, null, null, fp.file); pos.removeChild(scrollbox);回到原帖 这个太好用了,衷心感谢! 现在才真的意识到用截图软件滚屏是多么的麻烦。 |
|
4楼#
发布于:2011-03-05 11:24
手势太方便了,感谢2L提供
|
|
5楼#
发布于:2011-03-05 11:24
|
|
|