mixpanel/mixpanel-js

Target attribute other than _blank is ignored.

Opened this issue · 1 comments

We have noticed during our testing that when a url is passed through mixpanel javascript client, the target attribute with a value other than _blank is ignored. Therefore, no new tabs are opened, the linked page is opened in the original window.

Our very naive solution is to change this condition in mixpanel.js from
element.target === '_blank'
to
!(element.target.trim() === "")

to allow the target value to pass through. We are not aware of the reasons behind only allowing _blank.

Thanks.

To update, the following change worked for us as isEmpty() was causing problems.

!!element.target.trim()