Answer the question
In order to leave comments, you need to log in
Opening a browser tab in the same window on a QWebEngineView. Why is referrer not being passed?
There is a code:
class WebEnginePage(QWebEnginePage):
def createWindow(self, _type):
page = WebEnginePage(self)
page.urlChanged.connect(self.on_url_changed)
return page
@pyqtSlot(QUrl)
def on_url_changed(self, url):
page = self.sender()
self.setUrl(url)
page.deleteLater()
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.browser = QWebEngineView()
page = WebEnginePage(self.browser)
self.browser.setPage(page)
self.browser.setUrl(QUrl("http://yandex.ru"))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question