Page scripts cannot achieve the permission to take system screenshots;
Unless the browser itself provides an API, the browser itself is a client on the local system (local clients generally have the permission to capture screens);
However, the browser's screenshot API has limited permissions, that is, it can only capture pictures of the current browser window, but not pictures outside the browser. Example: Huaban.com's chrome browser plug-in;
I have noticed that the screenshot function of web qq and the web version of WeChat requires that a client (usually called a browser "plug-in") be installed locally to be able to take screenshots.
I just happened to be developing a chrome plug-in recently. Chrome has an API called captureVisibleTab, which can capture tabs into images in any format supported by webkit. I'm not sure about the rest, haha.
chrome.tabs.captureVisibleTab(integer windowId, object options, function callback)
It renders the current page into a canvas image. The specific method is to read the DOM elements and their styles and then render them into the canvas. No server rendering is required, the entire process is completed on the browser side.
I just happened to be developing a chrome plug-in recently. Chrome has an API called captureVisibleTab, which can capture tabs into images in any format supported by webkit. I'm not sure about the rest, haha.
https://developer.chrome.com/extensio...
You can try
html2canvasIt renders the current page into a canvas image. The specific method is to read the DOM elements and their styles and then render them into the canvas. No server rendering is required, the entire process is completed on the browser side.
Your name is Jing Wentian?