Remove inline onclick handlers #417

Closed
wants to merge 1 commit into
from

3 participants

@timoxley

Using your plugin in a chrome extension, and chrome forbids inline onclick handlers:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

See http://developer.chrome.com/extensions/contentSecurityPolicy.html

I've removed the two instances on onclick from select2. The first instance I swapped out to use your killEvent helper and the second one was superfluous since killEvent was being called in the handler anyway.

@ivaynberg

this was added as part of #330, any ideas?

@timoxley

Yeah no idea, I don't currently have an IE to test on so that kinda sucks.

@timoxley

From what I can tell from the link he posted, the actual solution is only dependent on the href="#" instead of href="javascript:void(0)", but I have no way to test this assertion.

@kevin-brown
Select2 member

The issue in #330 is now back in play because #487 had to reintroduce the changed line. Chosen fixed this previously by just stopping the propagation of the click, which seems like a really simple solution.

harvesthq/chosen#337

@timoxley

@kevin-brown yep, that was my thinking. This fix does kill the click event, so I'd be interested if it possibly solves both issues.

@ivaynberg

closing until a viable solution is found.

@ivaynberg ivaynberg closed this Feb 10, 2013
@rice rice referenced this pull request Apr 12, 2013
Merged

Remove inline styles #1180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment