Feature #967
openDisable automatic opening of links in a new tab
0%
Description
This would mirror the behavior of Privacy Browser Android, where a user must choose to open a link in a new tab.
It also fixes a bug where, at least sometimes, links automatically opened in new tabs do not load domain settings. For an example of this, clink on a tracking link in Order History at neweggbusiness.com.
Files
Updated by Soren Stoutner almost 2 years ago
It turns out this is a whole lot more difficult than I expected.
https://forum.qt.io/topic/93524/qwebengine-open-links-issue/12
Updated by Soren Stoutner over 1 year ago
3rdparty/chromium/third_party/blink/renderer/core/loader/navigation_policy.cc is getting close to the right place.
Updated by Soren Stoutner over 1 year ago
src/3rdparty/chromium/chrome/browser/ui/webui/history/navigation_handler.cc contains this example that only applies to navigating the history:
WindowOpenDisposition disposition = ui::DispositionFromClick(
middle_button, alt_key, ctrl_key, meta_key, shift_key,
(target_string == "_blank") ? WindowOpenDisposition::NEW_FOREGROUND_TAB
: WindowOpenDisposition::CURRENT_TAB);
It indicates that we are looking for something that calls ui::DispositionFromClick()
with the sixth argument set to WindowOpenDisposition::NEW_FOREGROUND_TAB
.
Updated by Soren Stoutner over 1 year ago
This is defined at src/3rdparty/chromium/ui/base/window_open_disposition.h
WindowOpenDisposition DispositionFromClick(
bool middle_button,
bool alt_key,
bool ctrl_key,
bool meta_key,
bool shift_key,
WindowOpenDisposition disposition_for_current_tab =
WindowOpenDisposition::CURRENT_TAB);
Meaning that, if nothing is specified, the current tab is used by default. So some place this is being set to WindowOpenDisposition::NEW_FOREGROUND_TAB
for _blank
.
Updated by Soren Stoutner over 1 year ago
It feels like it ought to be somewhere close to 3rdparty/chromium/content/renderer/render_frame_impl.cc
or 3rdparty/chromium/content/renderer/render_view_impl.cc
.
Updated by Soren Stoutner over 1 year ago
3rdparty/chromium/third_party/blink/public/web/web_navigation_params.h
Updated by Soren Stoutner over 1 year ago
- File remove-target-blank.patch remove-target-blank.patch added
- Status changed from New to In Progress
The attached patch implements this feature. However, this is not something that would be accepted upstream. It looks like I am going to have to release PrivacyWebEngine sooner than I had originally anticipated.