-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The outbound links version of the tracking code breaks links which 'break out' of an iframe. #987
Comments
The issue appears to be that in these cases that the code
I wonder whether, rather than adding in more special cases, a simpler approach for delaying the link being followed might be to intercept the event and then 're-dispatch' it after a short delay to make it less likely that the Plausible tracking code will interfere with the expected workings of the browser/page. Here is a codepen demonstrating roughly how this might work. Do let me know if you think this approach would be worth pursuing and/or if you think I am missing something. |
Thanks for looking into this @mocoso
See discussion in plausible/plausible-tracker#12. I wasn't able to get the re-dispatch idea to work across all browsers. If someone can figure out the code I would be happy to merge. The potential solution we discussed in the other thread is to move to |
I had missed the plausible-tracker repo so thanks for highlighting the existing issue.
|
Bug report
The outbound link version of the tracking breaks the ability of links inside iframes to 'break out' of the iframe when you include
target="_top"
as one of the<a>
tags attributes.So for example if a HTML page with the following code was included as an iframe in another page, the "link to Books Etc." link would fail to 'break out' of the iframe and the Books Etc. site would be displayed framed within the surrounding page.
Expected behavior
The expected behaviour is that clicking on the Books Etc. link above would break out of the iframe and open the Books Etc. website without it being framed.
Environment
This problem affects multiple browsers e.g. latest versions of Firefox and Chrome.
The text was updated successfully, but these errors were encountered: