提交qiming-dev-inject
This commit is contained in:
31
qiming-dev-inject/test-projects/html-project/index.html
Normal file
31
qiming-dev-inject/test-projects/html-project/index.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>HTML 静态项目 - dev-inject 测试</title>
|
||||
<!-- DEV-INJECT-START -->
|
||||
<script data-id="dev-inject-monitor">
|
||||
(function() {
|
||||
const remote = "https://testagent.xspaceagi.com/sdk/dev-monitor.js";
|
||||
const separator = remote.includes('?') ? '&' : '?';
|
||||
const script = document.createElement('script');
|
||||
script.src = remote + separator + 't=' + Date.now();
|
||||
script.dataset.id = 'dev-inject-monitor-script';
|
||||
script.defer = true;
|
||||
// 防止重复注入
|
||||
if (!document.querySelector('[data-id="dev-inject-monitor-script"]')) {
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<!-- DEV-INJECT-END -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>HTML 静态项目测试</h1>
|
||||
<p>测试 dev-inject 在纯 HTML 项目中的注入功能</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user