Сообщение об ошибке на Chrome Расширение: «Отказался от загрузки сценария, поскольку он нарушает следующую директиву Content Security Policy» - PullRequest
0 голосов
/ 14 марта 2020

Я делаю расширение Chrome, предоставляющее обновления Coronavirus, но когда я пытаюсь запустить его, я получаю эту ошибку:

Отказался от загрузки сценария 'chrome -extension: / /cdn.iframe.ly/embed.js ', поскольку он нарушает следующую директиву политики безопасности содержимого: "script-sr c' self 'blob: filesystem:". Обратите внимание, что «script-sr c -elem» не был задан явно, поэтому «script-sr c» используется в качестве запасного варианта.

Это код в моем манифесте. json file:

{
  "name": "Coronavirus Updates Extension",
  "version": "1.0",
  "description": "The Coronavirus Updates Extension will provide updates on the coronavirus so that every time you open a new tab, you can hear the latest updates on the coronavirus crisis.",
  "manifest_version": 2,
  "permissions": [
    "tabs",
    "http://www.vox.com/*",
    "http://www.cnn.com/*",
    "http://*.iframe.ly/",
    "http://www.nbcnews.com/*",
    "unlimitedStorage"
],

    "chrome_url_overrides" : {
      "newtab": "popup.html"
    }
}

И это код в моем всплывающем окне. html file:

<html lang="en">
    <head>
        <link rel="stylesheet"
            href="https://fonts.googleapis.com/css?family=Roboto+Condensed">
        <title="Coronavirus Live Updates">
        <meta charset="UTF-8">
        <meta name="author" content="Enzo Gilchrist">
        <style>
            body {
                font-family: 'Roboto Condensed', serif;
                font-size: 48px,
            }
        </style>
    </head>
    <body>
        <center>
            <h1>Coronavirus LIVE Updates</h1>
            <h3>Live updates on the coronavirus crisis, powered by your favorite news sources!</h3>
        </center>
        <center>

            <div class="iframely-embed"><div class="iframely-responsive" style="padding-bottom: 52.5%; padding-top: 120px;"><a href="https://www.cnn.com/world/live-news/coronavirus-outbreak-03-14-20-intl-hnk/index.html" data-iframely-url="//cdn.iframe.ly/v9YceJJ"></a></div></div><script async src="//cdn.iframe.ly/embed.js" charset="utf-8"></script><br>

            <div class="iframely-embed"><div class="iframely-responsive" style="padding-bottom: 52.5%; padding-top: 120px;"><a href="https://www.nbcnews.com/health/health-news/live-blog/coronavirus-updates-live-house-approves-coronavirus-aid-bill-n1158821" data-iframely-url="//cdn.iframe.ly/5trJ3RR"></a></div></div><script async src="//cdn.iframe.ly/embed.js" charset="utf-8"></script><br>

            <div class="iframely-embed"><div class="iframely-responsive" style="padding-bottom: 52.5%; padding-top: 120px;"><a href="https://www.vox.com/science-and-health/2020/1/23/21079069/coronavirus-update-usa-cases-news" data-iframely-url="//cdn.iframe.ly/Ds5QI8b"></a></div></div><script async src="//cdn.iframe.ly/embed.js" charset="utf-8"></script>



    </body>
<html>

Что мне делать?

...