60 WebBrowserWindow.networkManager().proxyAuthentication) |
60 WebBrowserWindow.networkManager().proxyAuthentication) |
61 |
61 |
62 self.fullScreenRequested.connect(self.__fullScreenRequested) |
62 self.fullScreenRequested.connect(self.__fullScreenRequested) |
63 |
63 |
64 self.urlChanged.connect(self.__urlChanged) |
64 self.urlChanged.connect(self.__urlChanged) |
|
65 |
|
66 self.__printer = None |
65 |
67 |
66 def acceptNavigationRequest(self, url, type_, isMainFrame): |
68 def acceptNavigationRequest(self, url, type_, isMainFrame): |
67 """ |
69 """ |
68 Public method to determine, if a request may be accepted. |
70 Public method to determine, if a request may be accepted. |
69 |
71 |
306 if accepted: |
308 if accepted: |
307 request.accept() |
309 request.accept() |
308 else: |
310 else: |
309 request.reject() |
311 request.reject() |
310 |
312 |
|
313 def printPage(self, printer): |
|
314 """ |
|
315 Public method to print the current page. |
|
316 |
|
317 Note: This is just a wrapper around QWebEnginePage.print() to ensure |
|
318 the printer object is available until the print job finished. |
|
319 |
|
320 @param printer reference to the printer object |
|
321 @type QPrinter |
|
322 """ |
|
323 self.__printer = printer |
|
324 self.print(self.__printer, self.__printFinished) |
|
325 |
|
326 def __printFinished(self, ok): |
|
327 """ |
|
328 Private method called when the print job finished. |
|
329 |
|
330 @param ok flag indicating a successful print |
|
331 @type bool |
|
332 """ |
|
333 self.__printer = None |
|
334 |
311 ############################################## |
335 ############################################## |
312 ## Methods below deal with JavaScript messages |
336 ## Methods below deal with JavaScript messages |
313 ############################################## |
337 ############################################## |
314 |
338 |
315 def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): |
339 def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): |