阅读:1193回复:0
【求助】addMenuPlus.uc.js 新增全页面截图菜单无法在 GitHub 截图
配置如下,这个怎么解决?
而且FF内置的截图工具也无法在 github 使用 page([ { label: "全页面截图", image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABISURBVDhPY6AOWPnmPwpGBuhy6PJggE8Buhy6PBjglEADA2/AMAAUhwHtDUDGyACbPAjDAV5JIMAmD8IkA7I1wgDFBmAABgYA9oelARp3ZZ4AAAAASUVORK5CYII=", oncommand: function () { function receiveMessage(message) { switch (message.name) { case 'addMenu_full_scrrenshot': if (message.data.image == "data:,") { addMenu.alert("截图失败"); } else { saveURL(message.data.image, null, addMenu.convertText("%TITLES%") + ".png", null, false, true, null, null, null, PrivateBrowsingUtils.isWindowPrivate(window), Services.scriptSecurityManager.createNullPrincipal({})); window.messageManager.removeMessageListener("addMenu_full_scrrenshot", receiveMessage); } break; } } window.messageManager.addMessageListener("addMenu_full_scrrenshot", receiveMessage); let frameScript = function () { var document = content.document; var canvas = document.createElement("canvas"); canvas.width = document.documentElement.scrollWidth; canvas.height = document.documentElement.scrollHeight; var ctx = canvas.getContext("2d"); ctx.drawWindow(content, 0, 0, canvas.width, canvas.height, "rgb(255,255,255)"); var data = { image: canvas.toDataURL("image/png") }; sendSyncMessage("addMenu_full_scrrenshot", data); } let frameScriptURI = 'data:application/javascript,' + encodeURIComponent('(' + frameScript.toString() + ')()'); gBrowser.selectedTab.linkedBrowser.messageManager.loadFrameScript(frameScriptURI, true); } } ]) |
|