iblrig.gui.tab_docs.CustomWebEnginePage
- class iblrig.gui.tab_docs.CustomWebEnginePage[source]
Custom implementation of QWebEnginePage to handle navigation requests.
This class overrides the acceptNavigationRequest method to handle link clicks. If the navigation type is a link click and the clicked URL does not start with a specific prefix (URL_DOC), it opens the URL in the default web browser. Otherwise, it delegates the handling to the base class.
Adapted from: https://www.pythonguis.com/faq/qwebengineview-open-links-new-window/
Decide whether to allow or block a navigation request.
- Parameters:
url (
QUrl
) – The URL being navigated to.navigationType (
QWebEnginePage.NavigationType
) – The type of navigation request.is_main_frame (
bool
) – Indicates whether the request is for the main frame.
- Returns:
True if the navigation request is accepted, False otherwise.
- Return type:
- Parameters:
url (QUrl)
navigationType (NavigationType)
is_main_frame (bool)