小编Sto*_*ght的帖子

如何为“npm run”提供默认脚本?

我的问题并不适合单行主题。如果有人键入的脚本名称不在我的 package.json 中,我想覆盖打印“缺少脚本”,而是打印一个文本文件,其中列出了我的scripts节点中的命令及其用途。

有没有办法做到这一点?

node.js npm

5
推荐指数
0
解决办法
118
查看次数

Google字体上的Chrome投掷内容安全政策错误

我已将Google字体URL添加到Content-Security-Policy标头的font-src指令中.我在Chrome 42中遇到以下错误:

Refused to load the stylesheet 'http://fonts.googleapis.com/css?
family=Open+Sans:300,400,400italic,600,800|Source+Code+Pro' because it violates the
following Content Security Policy directive: "style-src 'self' 'unsafe-inline'".
Run Code Online (Sandbox Code Playgroud)

我的标题字段如下所示:

Content-Security-Policy: default-src 'self'; font-src http://fonts.googleapis.com;
style-src 'self' 'unsafe-inline'
Run Code Online (Sandbox Code Playgroud)

google-chrome webfonts http-headers

4
推荐指数
1
解决办法
4944
查看次数

标签 统计

google-chrome ×1

http-headers ×1

node.js ×1

npm ×1

webfonts ×1