用about:config覆盖Firefox不安全的警告 [英] Override Firefox Insecure Warnings with about:config
问题描述
var canvas = document.createElement('canvas');
var ctx = canvas.getContext(2d);
ctx.drawWindow(window,0,0,100,200,rgb(255,255,255));
console.log(canvas.toDataURL(image / png));
但是,这似乎只保留了表单扩展名并引发错误:操作是不安全的。 / p>
我不需要把这个发布给任何其他人,我很乐意仅对我的Firefox进行一些内部调整,以避免创建扩展。是否有一些关于:配置设置(或其他)我可以调整,只要让它通过,即使它不是在扩展?
转到 about:config
并将 devtools.chrome.enabled
设置为 true
重新启动
转到您想要截取的选项卡
按 Shift +
将环境切换到浏览器
粘贴以下代码片段
var canvas = gBrowser.contentDocument.createElement('canvas');
var ctx = canvas.getContext(2d);
ctx.drawWindow(window,0,0,100,200,rgb(255,255,255));
canvas.toDataURL(image / png);将光标放在最后一行的末尾
按键,控制 + L
完成任务!
I am trying to write a simple batch script to take some screenshots of internal webpages on my end and came across the fact that firefox has this ability to render the window to canvas:
var canvas = document.createElement('canvas');
var ctx = canvas.getContext("2d");
ctx.drawWindow(window, 0,0, 100, 200, "rgb(255,255,255)");
console.log(canvas.toDataURL("image/png"));
However, this seems to be reserved only form extensions and throws an Error: The operation is insecure.
I don't need to publish this to anyone else and I'm happy to make some internal adjustment to only my Firefox to avoid creating an extension. Is there some sort of about:config setting (or something else) I can tweak to just let this go through even if it's not in an extension?
解决方案 Go to about:config
and set devtools.chrome.enabled
to true
Restart
Go to the tab you want to take screenshot
Press Shift+F4
Switch environment to Browser
Paste the following snippet
var canvas = gBrowser.contentDocument.createElement('canvas');
var ctx = canvas.getContext("2d");
ctx.drawWindow(window, 0,0, 100, 200, "rgb(255,255,255)");
canvas.toDataURL("image/png");
Place the cursor at the end of the last line
Press Control+L
Mission accomplished!
这篇关于用about:config覆盖Firefox不安全的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!