2013-10-01 25 views
0

当我尝试使用xmlhttprequest时,出现此错误,请让我知道如何解决它。如何在chrome封装的应用程序上使用xmlhttp请求

“,因为它违反了以下内容安全策略指令: ‘默认的src‘自我’’请注意,‘连接-src’中并没有明确设定, 这样‘默认-src’中被用作倒退。”

    var xmlhttp = new XMLHttpRequest(); 
     xmlhttp.onreadystatechange=function() 
      { 
      if (xmlhttp.readyState==4 && xmlhttp.status==200) 
      { 
      var resp  = xmlhttp.responseText; 

      } 
      } 
     xmlhttp.open("POST",myserviceURL,true); 
     xmlhttp.send();   

注:我添加清单权限列表上的网址。

Registers Chandru。

+0

您是否在清单中定义了'content_security_policy'? – apsillers

回答