-
-
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
outbound-links script causes media lightboxes to open in new tab #1941
Comments
@RobertJoonas Thank you for the fix for this issue in #1938. Any idea on when it will be pushed to master? |
Hey @ianmcilwraith! I'm currently working on some other things related to it so we will probably ship it all together. Don't want to make any strict promises but hopefully it won't be long. Fingers crossed! |
@ianmcilwraith, I'm now finalizing this bug fix in #2109. I wanted to ask if the issue was really in opening the lightbox link in a new tab? I tested on Ubuntu/Firefox + macOS Monterey/Firefox and from what I witnessed, the link opened in the same tab. I cannot think of any way that the current outbound-links script would cause the link to open in a new tab, as Plausible will not intercept when the link is set to open in a new tab. Can you please confirm? |
@RobertJoonas I just tested again and it the Lightbox link was opening in the same tab, not a new tab. Apologies if I misspoke in the initial comment! |
Hey @ianmcilwraith! Quick update: we've now deployed the fixed To test it, you can simply change the
Thanks for your help and feedback with this! :) |
So sorry for being late here @RobertJoonas, but I just confirmed on the live version that this is fixed and light boxes/outbound link tracking works as intended. |
Past Issues Searched
Issue is a Bug Report
Using official Plausible Cloud hosting or self-hosting?
Plausible Cloud from plausible.io
Describe the bug
I have two sites (WordPress) where lightboxes are in use, and of course on both sites Plausible is enabled with the Outbound Links script. On one site, the lightbox is used for images, and on the second site for videos. In both cases, the behavior witnessed is that the lightbox appears for a quick second before opening the image/video in a new tab. I narrowed down the issue to the Plausible
outbound-links.js
script causing this issue.This is the relevant section of the
outbound-links.js
script that was highlighted by the browser debugger as the last step before the redirection happened.(setTimeout(function(){a.href=e.href},150),t.preventDefault()))
This behavior does not happen with just the
plausible.js
script.This is the second site mentioned — clicking on the "Play Trailer" button will open a popup window for a second before redirecting to the linked video. The outbound links script is enabled on this site.
Happy to provide further debugging info as needed.
Expected behavior
The expected behavior is simply that the media opens in a lightbox and doesn't redirect to the media URL.
Screenshots
No response
Environment
The text was updated successfully, but these errors were encountered: