dodo
dodo copied to clipboard
Fix opening links with `target=_blank`
A <a href="..." target="_blank"> element can be used by websites to request a link to be opened in a new tab. For some reason, some links in mails seem to have target="_blank" set too.
When such a link is clicked, QtWebEngine emits a newWindowRequested signal instead of opening the link directly:
https://doc.qt.io/qt-6/qwebenginepage.html#newWindowRequested
This commit extracts the link opening code from acceptNavigationRequest to a _handle_link helper method, and also calls that when said signal is emitted.