WebBrowser/WebBrowserPage.py

branch
QtWebEngine
changeset 4752
a3bcc42a82a9
parent 4749
750577d35452
child 4753
8d2ea02ed785
equal deleted inserted replaced
4751:f745a556fd6f 4752:a3bcc42a82a9
45 from PyQt5.QtNetwork import QSslCertificate 45 from PyQt5.QtNetwork import QSslCertificate
46 SSL_AVAILABLE = True 46 SSL_AVAILABLE = True
47 except ImportError: 47 except ImportError:
48 SSL_AVAILABLE = False 48 SSL_AVAILABLE = False
49 49
50 # TODO: ExternalJsObject: move this to the object
50 ############################################################################### 51 ###############################################################################
51 ## 52 ##
52 ## 53 ##
53 ##class JavaScriptEricObject(QObject): 54 ##class JavaScriptEricObject(QObject):
54 ## """ 55 ## """
725 726
726 def __setupWebChannel(self): 727 def __setupWebChannel(self):
727 """ 728 """
728 Private method to setup a web channel to our external object. 729 Private method to setup a web channel to our external object.
729 """ 730 """
730 ## self.__externalJsObject = ExternalJsObject(self)
731 oldChannel = self.webChannel() 731 oldChannel = self.webChannel()
732 newChannel = QWebChannel(self) 732 newChannel = QWebChannel(self)
733 newChannel.registerObject("eric_object", ExternalJsObject(self)) 733 newChannel.registerObject("eric_object", ExternalJsObject(self))
734 self.setWebChannel(newChannel) 734 self.setWebChannel(newChannel)
735 735
751 751
752 ############################################## 752 ##############################################
753 ## Methods below deal with JavaScript messages 753 ## Methods below deal with JavaScript messages
754 ############################################## 754 ##############################################
755 755
756 # TODO: JavaScript messages: do this right and add the others
756 def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): 757 def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId):
757 print("JS-console:", message, lineNumber, sourceId) 758 print("JS-console:", message, lineNumber, sourceId)

eric ide

mercurial