I'm trying to write a script that detects clicks on a button for a page the HTML of which I do not control.
However, if I add an event listener on the document, the target of the event object is an element named "c-sto_com_fs-content-page", and not my "a.btn-primary" button. In Firefox the proprietary originalTarget property does show me the right element, but that's not a great help. The "c-sto_com_fs-content-page" element is located about halfway between my button and the document body. This page's HTML is a bit of a mess.
I figured I could simply querySelector my way to the button, and hook up an event listener that way, but document.querySelector("c-sto_com_fs-content-page a.btn-primary") also returns null. document.querySelector("c-sto_com_fs-content-page") returns the custom element, but I can't use this node to navigate down. It's as if this node's children do not exist.
How do I get this working?