iblqt.core.RestrictedWebEnginePage
- class iblqt.core.RestrictedWebEnginePage[source]
Bases:
QWebEnginePage
A
QWebEnginePage
subclass that filters navigation requests based on a URL prefix.Links that start with the specified trusted_url_prefix are allowed to load inside the application. All other links are opened externally in the default web browser.
Adapted from: https://www.pythonguis.com/faq/qwebengineview-open-links-new-window/
Handle and filter navigation requests.
- Parameters:
url (
QUrl
) – The target URL of the navigation request.navigationType (
NavigationType
) – The type of navigation eventis_main_frame (
bool
) – Whether the navigation occurs in the main frame.
- Returns:
True if the navigation should proceed in the web view; False if the link is handled externally.
- Return type: