我尝试将报表版本从2更新到3。chrome.tabs.captureVisibleTab抛出错误
Unchecked runtime.lastError: Either the '<all_urls>' or 'activeTab' permission is required.
由于“”在Manifest 3中不可用,所以我声明了“activeTab”权限。但不起作用。
作为我在Background.ts中的代码
export const getCapture = (): Promise<string> => {
return new Promise((resolve) => {
chrome.tabs.captureVisibleTab((dataUrl) => resolve(dataUrl));
});
};
Manifest.json
{
...,
"permissions": [
"contextMenus",
"tabs",
"activeTab"
],
}
那么,我如何使用这个api在Manifest 3中拍摄截图呢?或者我应该使用另一个api?
发布于 2022-01-04 04:20:36
有两种使用chrome.tabs.captureVisibleTab的方法:
https://stackoverflow.com/questions/70573509
复制相似问题