Answer the question
In order to leave comments, you need to log in
Can't run browserSync in gulp due to Content Security Policy in Chrome browser?
When the task is started, a page opens in the browser with the message "Cannot GET /"
Console
screen: Task code:
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
gulp.task('server', function() {
browserSync.init({
server: {
baseDir: "app/*.html"
}
});
});
Answer the question
In order to leave comments, you need to log in
You have a header somewhere on the server:
Either through PHP-shnuyu , or the header is registered in .htaccess or in the Apache / nginx / Denver config tp. Technically, browser extensions/plugins, including malicious ones, can also publish it .
Either remove this header entirely, or add a script-src directive to it :
Content-Security-Policy: default-src 'self';
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' appmakedev.xyz linkangood.com;
img-src 'self'
(and possibly add the domains from which you upload images). Content-Security-Policy: default-src 'self';
non-browser plug-in.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question