eric6/WebBrowser/Tools/Scripts.py

changeset 7717
f32d7965a17e
parent 7360
9190402e4505
child 7781
607a6098cb44
equal deleted inserted replaced
7716:313e09453306 7717:f32d7965a17e
13 # 13 #
14 14
15 15
16 from PyQt5.QtCore import QUrlQuery, QUrl 16 from PyQt5.QtCore import QUrlQuery, QUrl
17 17
18 from .WebBrowserTools import readAllFileContents 18 from .WebBrowserTools import getJavascript
19 19
20 20
21 def setupWebChannel(worldId): 21 def setupWebChannel(worldId):
22 """ 22 """
23 Function generating a script to setup the web channel. 23 Function generating a script to setup the web channel.
79 from WebBrowser.WebBrowserPage import WebBrowserPage 79 from WebBrowser.WebBrowserPage import WebBrowserPage
80 if worldId == WebBrowserPage.SafeJsWorld: 80 if worldId == WebBrowserPage.SafeJsWorld:
81 match = "// @exclude eric:*" 81 match = "// @exclude eric:*"
82 else: 82 else:
83 match = "// @include eric:*" 83 match = "// @include eric:*"
84 return source.format( 84 return source.format(match, getJavascript("qwebchannel.js"))
85 match, readAllFileContents(":/javascript/qwebchannel.js"))
86 85
87 86
88 def setupWindowObject(): 87 def setupWindowObject():
89 """ 88 """
90 Function generating a script to setup window.object add-ons. 89 Function generating a script to setup window.object add-ons.

eric ide

mercurial