Chrome's captureVisibleTab without extension

旧巷老猫 提交于 2019-12-13 01:37:12

问题


I know, that you can do screenshot of website in chrome extensions wit this: chrome.tabs.captureVisibleTab(null, {format: 'png'}, capturedImage);

But is this possible with just in javascript? I tried js plugin html2canvas, but these screenshots are terrible. My website is fulled with transitions/animations, 3D transforms... And that html2canvas is unable to make screenshot of that.

But I found chrome extension, which makes screenshot of website and that extension has made perfect job. Then I looked into extension's script and found that function captureVisibleTab.

Hope you know, what's my point. Do you know, how can I access to chrome.tabs? Or some other way, to use chrome's capture system?

EDIT: To compare original website and screenshot from html2canvas:

Original website:

HTML2Canvas screenshot:


回答1:


No, you can't.

It's a highly privileged API, and only an extension which was explicitly granted an extremely high access permission "<all_urls>" can use it.



来源:https://stackoverflow.com/questions/32453035/chromes-capturevisibletab-without-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!