I experimented with switching to synthesizing clicks rather than relying on href. This allowed me to dirty_stopper() elements that didn't or aren't supposed to have href attributes, such as form input submit buttons, not just a. It seemed to work, though n.b. the below doesn't address a bunch of cases (like clicking not actually ultimately navigating away...). The href approach might be more robust.
I experimented with switching to synthesizing clicks rather than relying on href. This allowed me to dirty_stopper() elements that didn't or aren't supposed to have href attributes, such as form input submit buttons, not just a. It seemed to work, though n.b. the below doesn't address a bunch of cases (like clicking not actually ultimately navigating away...). The href approach might be more robust.