How to let through my click event

I created a link and programmatically click it:

var a = document.createElement(“a”);
a.download = “mymap.png”;
a.href = canvasdata;
document.body.appendChild(a);
a.click();

The above code block successfully fires a click normally, however it would be blocked by the ionic tap event handling system because of this function in ionic.bundle.js :

function tapClickGateKeeper(e) {
//console.log('click ’ + Date.now() + ’ isIonicTap: ’ + (e.isIonicTap ? true : false));
if (e.target.type == ‘submit’ && e.detail === 0) {
// do not prevent click if it came from an “Enter” or “Go” keypress submit
return null;
}

// do not allow through any click events that were not created by ionic.tap
if ((ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target)) ||
(!e.isIonicTap && !ionic.tap.requiresNativeClick(e.target))) {
//console.log(‘clickPrevent’, e.target.tagName);
e.stopPropagation();

if (!ionic.tap.isLabelWithTextInput(e.target)) {
  // labels clicks from native should not preventDefault othersize keyboard will not show on input focus
  e.preventDefault();
}
return false;

}
}

This function does not let through click event without isIonicTap set to be true. So my own click event created in Javascript is blocked as well here.

How can I let my click event go through?