मैं क्रोम एक्सटेंशन बना रहा हूं, हालांकि मुझे ऑनक्लिक() ईवेंट को आग लगाने का प्रयास करते समय मुझे निम्न त्रुटि मिलती है।क्रोम-एक्सटेंशन इनलाइन जावास्क्रिप्ट आमंत्रण त्रुटि को कैसे ठीक करें?
Refused to load the script 'https://apis.google.com/js/client.js?onload=handleClientLoad' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:"
और
Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
यह मेरा manifest.json है:
{
"manifest_version": 2,
"name": "SECURE",
"description": "this extension offers secure communication for GMAIL users",
"version": "1.0",
"browser_action": {
"default_icon": "resources/icon16.png",
"default_popup": "popup.html",
"default_title": "Click here!"
},
"background":{
"scripts":["background.js"]
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js":["myscript.js"],
"run_at": "document_end"
}
],
"permissions": ["identity", "https://accounts.google.com/*", "https://www.googleapis.com/*"],
"oauth2": {
"client_id": "975410329966.apps.googleusercontent.com",
"scopes": [
"<all urls>",
"https://www.googleapis.com/auth/drive",
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.login",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send"
],
"content_security_policy":"script-src 'self' 'unsafe-inline' 'unsafe eval' https://apis.google.com/js/client.js?; object-src 'self'"
}
}
इस त्रुटि को ठीक करने की दिशा में किसी भी मदद की बहुत सराहना की जाएगी।
की संभावित डुप्लिकेट [Chrome एक्सटेंशन पॉपअप काम नहीं कर रहा, घटनाओं क्लिक संभाला नहीं कर रहे हैं] (https://stackoverflow.com/questions/17601615/the-chrome-extension-popup-is-not-working- क्लिक-घटनाओं-नहीं-नियंत्रित किया जाता है) – Makyen