Refused to execute inline script because it violates the following Content Security Policy directive: “script-src 'self'”

后端 未结 1 2005
梦谈多话
梦谈多话 2021-01-01 12:53

Im creating a chrome extension for Rss reader in that im getting the above error. please help

manifest.json



        
相关标签:
1条回答
  • 2021-01-01 13:22

    I also faced such type of problem when working with LinkedIn oAuth API.

    I was using linkedIn API with following settings for cordova

    config.xml

     <access origin="*" launch-external="yes"/>
      <allow-navigation href="*" />
    

    Meta Tag was

     <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
    

    Script

    <script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>
    

    When i run the application on emulator its giving

    Fixed Problem to add uri into meta tag http://platform.linkedin.com like

    <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://platform.linkedin.com ">
    
    0 讨论(0)
提交回复
热议问题