mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
22 lines
436 B
HTML
22 lines
436 B
HTML
<!DOCTYPE html>
|
|
<head>
|
|
<script>
|
|
function addRules() {
|
|
const script = document.createElement('script');
|
|
script.type = 'speculationrules';
|
|
script.innerText = `
|
|
{
|
|
"prerender": [
|
|
{"source": "list", "urls": ["target.html"]}
|
|
]
|
|
}
|
|
`;
|
|
document.head.append(script);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<button onclick="addRules()">add rules</button>
|
|
<a href="target.html">test</a>
|
|
</body>
|