Refused to execute inline event handler in chrome extension

1996 views
 

problem : chrome extension

Refused to execute inline event handler because it violates the following

Content Security Policy directive: "script-src 'self' blob: filesystem:

chrome-extension-resource:"

link for some study related this:

https://developer.chrome.com/extensions/contentSecurityPolicy

if any problem like as cannot-read-property-addeventlistener-of-null generated then use this code :

I think the easiest approach would be to just check that el is not null before adding an event listener:

var el = document.getElementById('yourbuttonid');

if(el){

el.addEventListener('click', yourfunction, false);

}

Channel:  rahul shukla
rubel rana 

Can you give me link of the stackoverflow solution you showed in your video?