I'm registering a simple click event like seen below:
$('.block--hero').on('click', '*[data-target-id]', function(e) {
e.preventDefault();
e.stopPropagation();
console.log('clicked');
});
Frequently, but not always, when I click on the interface element, I'll receive the following console error that I've identified as belonging to the LastPass
extension for Google Chrome.
Uncaught TypeError: Cannot read property 'location' of undefined onloadwff.js:726
lp_docinfoFromEvent onloadwff.js:726
icon_click_handler onloadwff.js:727
(anonymous function) onloadwff.js:139
When I receive this error, the clicked
message wasn't logged to the console. Essentially, the click event returned false
.
Normally, I'd just disable the extension and forget about it, but LastPass
is a pretty popular extension, and I'd like to somehow guarantee my intended behaviour. Users aren't going to know it's their extension causing the problem - only that the site doesn't work.
Is there a way around this?