{"id":1895,"date":"2018-04-25T12:20:55","date_gmt":"2018-04-25T10:20:55","guid":{"rendered":"https:\/\/blog.kodono.info\/wordpress\/?p=1895"},"modified":"2018-04-25T12:20:55","modified_gmt":"2018-04-25T10:20:55","slug":"content-security-policy-csp-blocks-scripts-from-violentmonkey-greasemonkey","status":"publish","type":"post","link":"https:\/\/blog.kodono.info\/wordpress\/2018\/04\/25\/content-security-policy-csp-blocks-scripts-from-violentmonkey-greasemonkey\/","title":{"rendered":"Content Security Policy (CSP) blocks scripts from Violentmonkey \/ Greasemonkey"},"content":{"rendered":"<p>I wanted to inject some codes on Github, however I received <code>Content Security Policy<\/code> errors. It&#8217;s because Github blocks this kind of injected code.<\/p>\n<p>To bypass this restriction I installed the addon <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/content-security-policy-o\/lhieoncdgamiiogcllfmboilhgoknmpi\">Content Security Policy Override<\/a> (if you have Firefox you can install this Chrome addon using <a href=\"https:\/\/addons.mozilla.org\/fr\/firefox\/addon\/chrome-store-foxified\/\">Chrome Store Foxified<\/a>) then I applied the below rule in the addon&#8217;s settings : <\/p>\n<pre>\r\n[\r\n  [\"https:\/\/github\\\\.com\/*\", [\r\n    [\"script-src\", \"script-src 'self' 'unsafe-inline' 'unsafe-eval'\"]\r\n  ]]\r\n]\r\n<\/pre>\n<p>Now my Violentmonkey script works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to inject some codes on Github, however I received Content Security Policy errors. It&#8217;s because Github blocks this kind of injected code. To bypass this restriction I installed the addon Content Security Policy Override (if you have Firefox you can install this Chrome addon using Chrome Store Foxified) then I applied the below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[15,170],"tags":[153,123],"class_list":["post-1895","post","type-post","status-publish","format-standard","hentry","category-astuce","category-english","tag-astuce","tag-english"],"_links":{"self":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/1895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/comments?post=1895"}],"version-history":[{"count":1,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/1895\/revisions"}],"predecessor-version":[{"id":1896,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/1895\/revisions\/1896"}],"wp:attachment":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/media?parent=1895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/categories?post=1895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/tags?post=1895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}