然后就是代码:
enum all {
a = 'a',
b = 'b',
c = 'c',
}
// what I want enum
enum wanted {
c = 'c',
}
Run Code Online (Sandbox Code Playgroud)
我知道有一些解决方案,比如
type wanted = Exclude<all, all.a | all.b> // type wanted = all.c
Run Code Online (Sandbox Code Playgroud)
但类型与枚举不同,因为它是不可迭代的!
我尝试将清单版本从 2 更新到 3。并且 chrome.tabs.captureVisibleTab 抛出错误
Unchecked runtime.lastError: Either the '<all_urls>' or 'activeTab' permission is required.
Run Code Online (Sandbox Code Playgroud)
由于“<all_urls>”在 Manifest 3 中不可用,因此我声明了“activeTab”权限。但这不起作用。
作为我在Background.ts中的代码
Unchecked runtime.lastError: Either the '<all_urls>' or 'activeTab' permission is required.
Run Code Online (Sandbox Code Playgroud)
清单.json
{
...,
"permissions": [
"contextMenus",
"tabs",
"activeTab"
],
}
Run Code Online (Sandbox Code Playgroud)
那么如何在Manifest 3中使用这个api进行截图呢?或者我应该使用另一个api?