This repository has been archived on 2023-09-06. You can view files and clone it, but cannot push or open issues/pull-requests.
yutent
/
py-gtk-notes
Archived
1
0
Fork 0
py-gtk-notes/app.js

29 lines
537 B
JavaScript

/**
* {}
* @author yutent<yutent.io@gmail.com>
* @date 2023/07/20 14:19:13
*/
import 'es.shim'
import { $, bind } from 'wkit'
function test1() {
try {
window.webkit.messageHandlers.app.postMessage({
data: { foo: 'Test 1' }
})
$('#output').innerHTML = '这是没有回调的 '
} catch (err) {
alert(err)
}
}
function test2() {
native.handler('blabla', { foo: 'bar' }).then(r => {
$('#output').innerHTML = JSON.stringify(r)
})
}
bind($('.btn1'), 'click', test1)
bind($('.btn2'), 'click', test2)
python + gtk3 + webkit2 学习笔记
Python 60.1%
JavaScript 37.6%
HTML 2.3%