-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (51 loc) · 1.56 KB
/
Copy pathindex.html
File metadata and controls
51 lines (51 loc) · 1.56 KB
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>
<head>
<base href="/">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> -->
<title>Docker Monitor</title>
<link rel="icon" type="image/png" href="favicon.png">
<link rel="manifest" href="manifest.json">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
</head>
<body>
<script>
// 修复国内无法访问 gstatic.com 的问题:强制使用本地 CanvasKit
// 通过拦截 _flutter.loader 实现对 load() 调用的 canvasKitBaseUrl 注入
(() => {
const _flutterObj = {};
let _realLoader = null;
Object.defineProperty(_flutterObj, 'loader', {
configurable: true,
enumerable: true,
get() { return _realLoader; },
set(v) {
_realLoader = v;
if (v && v.load) {
const _origLoad = v.load;
v.load = function(opts) {
opts = opts || {};
opts.config = opts.config || {};
// 强制使用本地 canvaskit 目录,避免从 gstatic.com CDN 加载
opts.config.canvasKitBaseUrl = opts.config.canvasKitBaseUrl || 'canvaskit';
return _origLoad.call(this, opts);
};
}
}
});
window._flutter = _flutterObj;
})();
</script>
<script src="autofill_hints.js"></script>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>