Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vimeo Content Security Policy error - Refused to load the script

Tags:

video

embed

vimeo

When I'm trying to embed video from vimeo to my site, I get error in chrome console -

Refused to load the script 'data:application/javascript;base64,dmFyIHVyY2hpblRyYWNrZXI9ZnVuY3Rpb24oKXt9…RUcmFja2VyQnlOYW1lOiBmdW5jdGlvbigpe190cmFja0V2ZW50OiBmdW5jdGlvbigpe319fTs=' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' https://f.vimeocdn.com https://ssl.google-analytics.com https://js-agent.newrelic.com https://bam.nr-data.net https://f.vimeocdn.com".

I get same error in all sites, thats contains vimeo player. For example - https://player.vimeo.com/video/174560759

That error crash my javascript, which communicate with Vimeo player API.

Maybe somebody knows, what's wrong with Vimeo, and how I can resolve this problem?

P.S. Firefox just shows me warning in console, and my js works well.

like image 412
erizoy Avatar asked Feb 15 '17 16:02

erizoy


People also ask

How do I fix refused to load the script?

To fix the issue you have to add `https://localhost:5000` host-source to the script-src directive. Alternatively you can use syntax 'https://localhost:*' to allow any ports.

How do I fix content security policy blocks inline execution of scripts and stylesheets?

The Content Security Policy (CSP) prevents cross-site scripting attacks by blocking inline execution of scripts and style sheets. To solve this, move all inline scripts (e.g. onclick=[JS code]) and styles into external files. adding the hash or nonce of the inline script to your CSP header.

How do I fix the content security policy of your site blocks the use of eval in JavaScript?

The Content Security Policy (CSP) prevents the evaluation of arbitrary strings as JavaScript to make it more difficult for an attacker to inject unauthorized code on your site. To solve this issue, avoid using eval() , new Function() , setTimeout([string], ...) and setInterval([string], ...) for evaluating strings.


1 Answers

I found this error to be caused by the uBlock Origin extension. It may also be triggered by others like AdBlock.

Try browsing in Incognito or starting Chrome without extensions to see if the problem persists.

like image 132
Jordan Avatar answered Nov 14 '22 13:11

Jordan