Targeted Links Issue

For the past month or so I have been unable to open links targeted to open in a new tab (ie target="_blank") This is happening across all websites that I visit. The targeted links work correctly in other browsers. Is this happening to anyone else?

What happens when you click one of those links? For example:

  • The page opens in the same tab instead of a new tab or window
  • Tab starts opening and immediately closes
  • Nothing happens

Do you have any extensions installed related to tabs or popup windows?

Thank you for your idea to look at the extensions. There were only five active extensions, I disabled all and the problem reported above is no longer occurring (None of the extensions were related to tabs or popups). Reactivated each of the extensions, and it works correctly. Must have been related to the extensions. The problem was that the page would jump slightly, no tabs would open and the link would not either. Thank you again. Happy New Year!

The problem has returned. I have all extensions disabled. Any other thoughts?

@jscher2000 Unchecking this preference seems to work though it does seem odd: ‘Block pop-up windows’ Thoughts?

Normally user-initiated events like clicks are an exception to popup blocking. Has click been removed from the list for this preference in about:config?

  • Name: dom.popup_allowed_events
  • Default value: change click dblclick auxclick mouseup pointerup notificationclick reset submit touchend contextmenu

If it’s bolded and modified in some way, the left-arching arrow at the right end of the row should restore it to its default value.

It does not appear to be modified.

If you test in Firefox’s Safe Mode – disables extensions, userChrome.css, and various other features – can you enable the popup blocker and get links to open normally?

https://support.mozilla.org/kb/troubleshoot-firefox-issues-using-safe-mode

Thank you for this. Unfortunately, the problem persists. I tried logging into safe-mode twice to be certain. While in safe-mode, if I uncheck ‘Block pop-up windows’ it works. With it checked, it’s not working. My version is 85.0b4 (64-bit) if that helps.

I’m baffled. What if you test on a new profile?

This takes about 3 minutes, plus the time to test a site with targeted links (like startpage.com results).

Inside Firefox, type or paste about:profiles in the address bar and press Enter/Return to load it.

Take a quick glance at the page and make a mental note of which Profile has this notation: This is the profile in use and it cannot be deleted. That is your current default profile.

Click the “Create a New Profile” button, then click Next. Assign a name like Jan2021, ignore the option to relocate the profile folder, and click the Finish button.

Firefox will switch your default profile to the new one, so click the Set as Default Profile button for your regular one to avoid an unwanted surprise at your next startup.

Scroll down to Jan2021 and click its Launch profile in new browser button.

Firefox should open a new window that looks like a brand new, uncustomized installation. (Your existing Firefox window(s) should not be affected.) Please ignore any tabs enticing you to connect to a Sync account or to activate extensions found on your system to get a clean test.

Do the links open normally in the new profile?

When you are done with the experiment, you can close the extra window without affecting your regular Firefox profile. (Jan2021 will remain available for future testing.)

I setup a new profile as you suggested. The targeted links work correctly on Startpage.com, but not on several WordPress websites I manage. What is very odd is that both Startpage and the site in my example Screencast, is the target and rel details are the same. Could this be something internal with WordPress? For now, I’ll leave the ‘Block pop-up windows’ unchecked. I greatly appreciate your help.

I can reproduce this issue on the website from your screencast (https://doubleaction.com/special-orders/)

There is a script attached to the link which prevents the default navigation and instead calls “window.open” in javascript. You can find the related code by looking at the info in the “event” badge in the DevTools inspector.

The script is hosted at
https://doubleaction.com/wp-content/cache/autoptimize/js/autoptimize_c380e1896cbe551ce5d72164a41dc9e2.js

The unminified event handler is:

  function t(e) {
    var t,
    o,
    i,
    d;
    return e = e || window.event,
    t = e.currentTarget || e.srcElement,
    i = t.getAttribute('href'),
    i && (d = e.ctrlKey || e.shiftKey || e.metaKey, o = t.getAttribute('target'), d || o && !r(o)) ? (n.open(i), e.preventDefault ? e.preventDefault() : e.returnValue = !1, !1) : void 0
  }

here you can see the n.open(i) part, which will end up calling window.open. So even though this is a link, the script on the page cancels the event and triggers a popup open.

So I think it makes sense that Firefox behaves differently. What is weird however is that the “popup blocking” bar displayed by Firefox is displayed for only a second before it disappears, making it more difficult to understand what happens.

The console shows “Opening multiple popups was blocked due to lack of user activation.”. Maybe the script confuses the popup blocker logic at https://searchfox.org/mozilla-central/rev/f8a41209af503016e78278774052d48d8c52b91c/dom/base/nsGlobalWindowOuter.cpp#5764-5772 ?

I think it’s worth filing a bug, at least to understand why the popup blocking bar gets hidden. (edit: filed https://bugzilla.mozilla.org/show_bug.cgi?id=1685056 )

The problem being discussed here, is also occurring (for me) within Wordpress’s own links which are part of their core software as seen in this Screencast. Thank you for your help.

I don’t have a wordpress instance to test it, but I guess those links also use window.open somehow instead of following the link.

Ok. I also tried deactivating the cache plugins. Problem persists.

@wpdv the investigation made a lot of progress on https://bugzilla.mozilla.org/show_bug.cgi?id=1685056 . The regressing bug was identified, and seems to have been introduced in Firefox 85.

The code that triggered the regression seems to come from a WordPress plugin called iThemes Security. Any chance you have this one enabled on your websites?

@jdescottes Yes, that plugin is being used. Should I contact the developers and provide them the link to this page and the other page where you guys are working on this issue? Or what would you recommend? Thanks!

@jdescottes I do believe you nailed it!! I deactivated this setting within iThemes Security > WordPress Tweaks > Protect Against Tabnapping and the issue has now been resolved. I would like to thank you and your teammates for solving this problem. I will direct the developers of this plugin to these pages. Have a wonderful day!!

Thanks for the feedback, really happy we could help. @emilio1 did all the investigation, and has already submitted a fix.
Also it’s great to know that it’s really the tabnapping bit of the plugin that causes issues, so thanks for testing it and reporting back.

I think we will get in touch with the plugin maintainer to see if they can fix the browser compat issue. But if you want to contact them on your side, it will show that it’s important to fix, and not only to please Firefox engineers :slight_smile:

@jdescottes yes, I did contact them as well. Thank you again Julian and @emilio1 !!