-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew.html
51 lines (47 loc) · 1.58 KB
/
new.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="node_modules/screenlog/dist/screenlog.min.js"></script>
<link rel="stylesheet" href="node_modules/mdui/dist/css/mdui.min.css" />
<title>程序运行日志</title>
</head>
<body>
<button onclick="down();" class="mdui-fab mdui-fab-mini mdui-fab-fixed mdui-ripple ">
<i class="mdui-icon material-icons"></i>
</button>
<i class="mdui-icon material-icons mdui-center"></i>
<div id="test" style="overflow-y: auto;height: 90vh;">
</div>
</body>
<script>
var log = require('electron-log');
log.transports.console.level = 'silly';
const fs = require('fs')
const content = fs.readFileSync(log.transports.file.getFile().path)
const message = document.getElementById('test')
message.innerText = content.toString()
const ipc = require('electron').ipcRenderer
const remote = require('electron').remote;
const FindInPage = require('electron-find').FindInPage;
let findInPage = new FindInPage(remote.getCurrentWebContents());
ipc.on('on-find', (e, args) => {
findInPage.openFindWindow()
})
</script>
<script type="text/javascript">
function down() {
const div = document.getElementById('test')
console.log(div.scrollHeight)
div.scrollTop = div.scrollHeight
console.log(div.scrollTop)
}
</script>
<style>
body {
overflow: hidden;
}
</style>
</html>