更新时间:2023-12-05 20:00:52
I guess your code is taken from the example given on the Chrome Extension Website and yes, it's buggy.
Change the permission attribute inside the manifest.json to this:
"permissions": [
"tabs"
,"<all_urls>"
]
Cheers, David