javascript - Chrome Extension: yql API ERROR: Content Security -
i trying make call yql api. error: have following
manfiest.json: "content_security_policy": "script-src 'self'; object-src 'self'", error: refused load script 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where…withkeys&callback=jquery20208888747137971222_1400373036635&_=1400373036638' because violates following content security policy directive: "script-src 'self' chrome-extension-resource:".'
i tried doing w/o having "content_security_policy" still error.
the code call:
yqlapi = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeuricomponent(query) + ' &format=json&env=store%3a%2f%2fdatatables.org%2falltableswithkeys&callback=?'; $.getjson(yqlapi, function(r){ $.each(r.query.results.li, function(){ if(typeof this.font !== 'undefined') { gogoanime1.push([this.a.href,this.font.content]); } }); gotfollowersofa(gogoanime1);});
i have been looking in csp (https://developer.chrome.com/extensions/contentsecuritypolicy#relaxing-remote-script) don't understand have add manifest.json. make work appreciated!
i wonder if that's because of requesting external object.
content security policy (csp) - google chrome
if have need external javascript or object resources, can relax policy limited extent whitelisting secure origins scripts should accepted.
so adjust accordingly, manfiest.json:
"content_security_policy": "script-src 'self'; object-src 'self' https://query.yahooapis.com/"
and you'll need use https origin:
as man-in-the-middle attacks both trivial , undetectable on http, origins not accepted. currently, allow whitelisting origins following schemes: https, chrome-extension, , chrome-extension-resource.
Comments
Post a Comment