You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
<html>
<head>
<title>An example of a link in an iframe</title>
<script async defer data-domain="example.test" src="https://plausible.io/js/plausible.outbound-links.js"></script>
</head>
<body>
<h2>Inside an iframe</h2>
<p>
This <a href="https://www.booksetc.co.uk/" target="_top">link to Books Etc.</a> as <code>target="_top"</code> and so clicking on it should break out of the surrounding page.
</p>
</body>
</html>
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:
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.
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
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 sendBeacon instead so we don't have to delay at all.
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: