Refused to execute inline event handler because it violates the following Content Security Policy directive: "xxx". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...')
/*********************************************************************************
* Refused to execute inline event handler because it violates the following Content Security Policy directive: "xxx". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
* 说明:
* 主要是没想到Chrome扩展的HTML中不能添加事件,只能在JS中动态添加。
*
* 2018-4-10 深圳 宝安西乡 曾剑锋
********************************************************************************/ 一、参考文档:
. Content Security Policy (CSP)
https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-inline-script
. Content Security Policy Reference
https://content-security-policy.com/
. Chrome Extension 中的 CSP(Content Security Policy) 开发小记
https://div.io/topic/1669
. Chrome自定义插件—小温之家的私人订制
http://wenqy.com/2017/03/06/chrome%E8%87%AA%E5%AE%9A%E4%B9%89%E6%8F%92%E4%BB%B6-%E5%B0%8F%E6%B8%A9%E4%B9%8B%E5%AE%B6%E7%9A%84%E7%A7%81%E4%BA%BA%E8%AE%A2%E5%88%B6.html 二、解决办法:
在JS中注册触发事件。
Refused to execute inline event handler because it violates the following Content Security Policy directive: "xxx". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...')的更多相关文章
- options.html:1 Refused to load the script 'xxxx' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".
/********************************************************************************* * options.html:1 ...
- Chrome插件在页面上直接绑定JavaScript事件提示Refused to execute inline event handler because it violates the following Co
Chrome插件问了安全是不提倡在页面上直接写JavaScript的,如果出现了这个提示,其实也没有什么,同样可以运行. 从Chrome Extenstion V2开始,不允许执行任何inline j ...
- Executing a script from Nagios event handler fails to run
I have Nagios running on a webserver. For this one Nagios service check in particular, if it fails, ...
- Linux kernel的中断子系统之(四):High level irq event handler
返回目录:<ARM-Linux中断系统>. 总结:从架构相关的汇编处理跳转到Machine/控制器相关的handle_arch_irq,generic_handle_irq作为High l ...
- Linux中断 - High level irq event handler
一.前言 当外设触发一次中断后,一个大概的处理过程是: 1.具体CPU architecture相关的模块会进行现场保护,然后调用machine driver对应的中断处理handler 2.mach ...
- Event Handler
在Event Handler中,有一种特殊的Event Handler,称之为Synchronizer或者Denormalizer,其作用就是为了同步“Query Database”.Query Da ...
- SharePoint中Event Handler的触发
一直以来对于Event Handler的感觉就是:添加.编辑和删除动作之前和动作之后,我们在SharePoint系统中可以做的一些事情 不过在最近处理的一个问题中,发现它在触发时机上出了一点问题 ...
- SSIS ->> Event Handler
Event Handler支持在某个事件触发的时候定义好处理该事件的逻辑,比如错误事件触发是该怎么处理.它跟Control Flow界面相似,就好像执行了另外一个包一样.Event Handler不仅 ...
- JPA project Change Event Handler问题解决[转]
转至:http://my.oschina.net/cimu/blog/278724 这是Eclipse中的一个GUG: Bug 386171 - JPA Java Change Event Handl ...
随机推荐
- C++ 四种新式类型转换
static_cast ,dynamic_cast,const_cast,reinterpret_cast static_cast 定义:通俗的说就是静态显式转换,用于基本的数据类型转换,及指针之间的 ...
- Python日志、序列化、正则模块
使用Python内置模块的目的:拿来别人已经写好的模块功能,直接import内置模块使用,简化程序,避免重复造轮子的过程,提示自己的开发效率: 一. loging日志模块: 1. loging模块可以 ...
- docker 安装nginx、php-fpm
运行环境: 创建目录: mkdir -p /Users/sui/docker/nginx/conf.d && mkdir /Users/sui/www && cd /U ...
- zookeeper 的心跳
假定:主机 A, B 通过 tcp 连接发送数据,如果拔掉 A 主机的网线,B 是无法感知到的.但是如果 A 定时给 B 发送心跳,则能根据心跳的回复来判断连接的状态. 以 zookeeper 为例: ...
- stealwatch里的安全功能——ETA结果会显示加密套件以及key长度,还有流量大小(例如41MB)
以后可以考虑的方向,在stealwatch里包含: ad Injector click fraud cryptocurrency miner exploit kit malicious adverti ...
- PowerShell使用教程
一.说明 1.1 背景说明 个人对PowerShell也不是很熟悉,开始的时候就突然看到开始菜单中多了个叫PowerShell的文件夹,后来一点就看到某个教程视频说PowerShell很厉害但也没怎么 ...
- python3实现的rtsp客户端脚本
一.说明 此客户端使用python3编写 此客户端实现RTSP的OPTIONS, DESCRIBE, SETUP , PLAY, GET_PARAMETER,TEARDOWN方法,未实现ANNOUNC ...
- assert用法
assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: void assert( int expression ); assert的作用 ...
- 比较不错的几款开源的WPF Charts报表控件
UWP Community Toolkit 1. ModernUIChart Code: http://modernuicharts.codeplex.com/ Available Charts Co ...
- mybatis输出sql语句
方法一: 这种方法是mybatis官网上介绍的,比较好用: log4j.properties: log4j.rootLogger=ERROR,consolelog4j.appender.console ...