We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this scenarior should work, but it does not, as something disables preprendering
import http from 'node:http'; // Works in Chrome only // Be sure to start Chrome with Preference "net.network_prediction_options" set to 3 export default async function (browser) { let server; try { server = http.createServer(function (_, res) { res.write(` <html> <head> <script type="speculationrules"> { "prerender": [ { "urls": ["next.html"], "eagerness": "immediate" } ] } </script> </head> <body> <h1>0008-speculationrules</h1> <a href="/next.html">prerender</a> </body> </html> `); res.end(); }).listen(8080, ()=> {}); const puppeteerBrowser = await browser.getPuppeteer() await browser.call(async () => { const [page] = await puppeteerBrowser.pages(); const client = await page.target().createCDPSession(); await client.send('Page.setPrerenderingAllowed', { isAllowed: true }); }); await browser.navigateTo("http://localhost:8080"); // TODO: required for Firefox - find something to wait for that will be faster await new Promise(r => setTimeout(r, 1000)); } finally { server.closeAllConnections(); await new Promise(r => server.close(r)); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
this scenarior should work, but it does not, as something disables preprendering
The text was updated successfully, but these errors were encountered: