ignore prefetch and preload script links

related to:
1. https://github.com/rrweb-io/rrweb/issues/52
2. https://github.com/rrweb-io/rrweb/issues/297
3. https://github.com/rrweb-io/rrweb/issues/597
This commit is contained in:
Yanzhen Yu
2021-07-13 22:29:22 +08:00
parent 10eead6d42
commit 47b555a46f
4 changed files with 51 additions and 7 deletions

View File

@@ -226,6 +226,17 @@ exports[`[html file]: picture.html 1`] = `
</body></html>"
`;
exports[`[html file]: preload.html 1`] = `
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
<meta charset=\\"UTF-8\\" />
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
<title>Document</title>
<link />
<link />
</head>
<body></body></html>"
`;
exports[`[html file]: shadow-dom.html 1`] = `
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
<meta charset=\\"UTF-8\\" />

11
test/html/preload.html Normal file
View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="preload" href="https://example/path/to/preload.js" as="script" />
<link rel="prefetch" href="https://example/path/to/prefetch.js" />
</head>
<body></body>
</html>