Sunday, May 19, 2024
58
rated 0 times [  63] [ 5]  / answers: 1 / hits: 12721  / 3 Years ago, fri, april 16, 2021, 12:00:00

I am trying to create a chrome extension. My manifest file is


{
"name": "Alert-Beep",
"action": {},
"manifest_version": 3,
"version": "0.1",
"description": "Beeps if alert() is called",
"content_security_policy": "script-src 'self'; object-src 'self'",
"permissions": [
"activeTab",
"scripting"
],
"content_scripts": [
{
"matches": ["https://*.com/*"],
"js": ["alert-beep.js"],
"run_at": "document_start"
}
]
}

Loading the extension fails with the message


Failed to load extension
File
~alert-beep
Error
Invalid value for 'content_security_policy'.
Could not load manifest.

What am I doing wrong?


More From » google-chrome-extension

 Answers
7

An additional example that helped me:


manifest v3


"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'; script-src-elem 'self' 'unsafe-inline' https://music.yandex.ru/;"
}

[#1471] Friday, April 9, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aileent

Total Points: 556
Total Questions: 107
Total Answers: 101

Location: Croatia
Member since Fri, Sep 11, 2020
4 Years ago
aileent questions
;