mirror of
https://github.com/allankoechke/pywebview.git
synced 2026-12-02 01:33:02 +00:00
Code cleanup
This commit is contained in:
@@ -12,21 +12,12 @@ def evaluate_js():
|
||||
# Change document background color and print document title
|
||||
print(webview.evaluate_js(
|
||||
"""
|
||||
window.pywebview = {
|
||||
api: {}
|
||||
}
|
||||
var test = function(funcList) {
|
||||
for (var i = 0; i < funcList.length; i++) {
|
||||
pywebview.api[funcList[i]] = function (params) {
|
||||
alert(params)
|
||||
//return window.external.Invoke(funcList[i], params)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test(['test', 'test2'])
|
||||
pywebview.api.test('1')
|
||||
// Turn night mode ON
|
||||
document.body.style.backgroundColor = '#212121';
|
||||
document.body.style.color = '#f2f2f2';
|
||||
|
||||
// Return document title
|
||||
document.title;
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -142,10 +142,6 @@ class BrowserView:
|
||||
if self.first_load:
|
||||
self.web_browser.Visible = True
|
||||
self.first_load = False
|
||||
print('hello')
|
||||
|
||||
def on_message(self, sender, args):
|
||||
print('sender: {0}/nargs: {1}/ntest: {2}'.format(sender, args))
|
||||
|
||||
def toggle_fullscreen(self):
|
||||
if not self.is_fullscreen:
|
||||
|
||||
Reference in New Issue
Block a user