Open duhrer opened 7 months ago
Given that we can only get the list of listeners in the dev console, we have no good options thus far.
Someone suggested making the anchor tag into a button, which did work, but had side effects, both visually, and in terms of not working as expected. Basically a pause button replaces the play and it doesn't seem like replacing that with a <button/>
works.
This may be the kind of thing we have to document in terms of "sites we can't work with".
Sites like Dollar Country embed the libsyn player. The play button is a link whose
href
is inline javascript, i.e.href="javascrip:void[0];"
[sic].If you try to click this type of link using an element's
click
method, you'll get a CSP error like:Sadly, you cannot just surround this type of error in a
throw
/catch
block, rather you have to listen for a particular error, which means you can't make the original click process continue.I'm kind of grasping at straws for solutions here, but perhaps we can:
href
.click
handlers and save them to a local variable.href
from the element.click
handlers, perhaps inside a wrapper that issuesevent.preventDefault
.