Closed gadamsgh closed 5 years ago
Is there a way to simply cancel a navigation?
Example main.js:
const carlo = require('carlo'); (async () => { const app = await carlo.launch({args:['--auto-open-devtools-for-tabs']}); app.on('exit', () => process.exit()); app.serveFolder(__dirname); app.serveHandler(async function (request) { request.url() === 'http://www.github.com/' ? request.abort() : request.continue(); }); await app.load('https://www.google.com'); })();
In this example, we launch to www.google.com and then navigate to github.com from the console. window.location = 'http://www.github.com/'
window.location = 'http://www.github.com/'
What I'd like to do in this case is leave the user where they were before attempting to navigate, without reloading. Is this possible?
Fixed as https://github.com/GoogleChromeLabs/carlo/commit/17d972c6d43b0c2ede063b334c723f743dfbaa5c
Is there a way to simply cancel a navigation?
Example main.js:
In this example, we launch to www.google.com and then navigate to github.com from the console.
window.location = 'http://www.github.com/'
What I'd like to do in this case is leave the user where they were before attempting to navigate, without reloading. Is this possible?