SafariExtensions icon indicating copy to clipboard operation
SafariExtensions copied to clipboard

FB11958284 - target="_blank" and command-click don't work in extension pages

Open lapcat opened this issue 2 years ago • 6 comments

Safari 16.2 (17614.3.7.1.7, 17614) on macOS 12.6.2 (21G320)

target="_blank" and command-click don't work in extension pages. They open links in the same tab rather than in a new tab. The attached sample project uses an extension preference page, but this happens in any extension page, such as one opened by runtime.getURL() and tabs.create().

Steps to reproduce:

  1. Unzip, open, build, and run the attached sample Xcode project TargetBlankBug
  2. Enable the extension in Safari Extensions Preferences
  3. Click the Preferences button in Safari Extensions Preferences to open the extension preferences in a tab
  4. Click on the target="_blank" link, or command-click on it

Expected results: The link opens in a new tab.

Actual results: The link opens in the same tab.

TargetBlankBug.zip Strangely, this bug only occurs on Mac. target="_blank" works correctly in Mobile Safari.

lapcat avatar Jan 20 '23 03:01 lapcat

@lapcat Just tried this on macOS with Safari Version 18.3.1 and could not reproduce the issue.

carlosjeurissen avatar Mar 27 '25 13:03 carlosjeurissen

@lapcat Just tried this on macOS with Safari Version 18.3.1 and could not reproduce the issue.

I can still reproduce it.

The Apple Feedback is still open too.

lapcat avatar Mar 27 '25 13:03 lapcat

See attachment for my reproduction. In general I would not trust the open state of a Feedback report)

https://github.com/user-attachments/assets/c07f72b2-b6c9-4dfb-a603-6600f8b42902

carlosjeurissen avatar Mar 27 '25 14:03 carlosjeurissen

Those aren't the steps to reproduce. Use the Settings (formerly Preferences) button in the Safari Extensions Settings pane.

lapcat avatar Mar 27 '25 14:03 lapcat

@lapcat Thanks for clarifying! Can reproduce the issue now.

carlosjeurissen avatar Mar 27 '25 14:03 carlosjeurissen

Opened an issue for this bug https://bugs.webkit.org/show_bug.cgi?id=290532

carlosjeurissen avatar Mar 27 '25 14:03 carlosjeurissen