[BUG] Download event not fired when launched with persistent context
See original GitHub issueContext:
- Playwright Version: 1.2.1
- Operating System: Mac
- Node version: 14.5
- Browser: Chromium
Code Snippet
const { chromium } = require("playwright");
(async () => {
const context = await chromium.launchPersistentContext("./udd", {
headless: false,
acceptDownloads: true,
downloadsPath: "./",
});
context.on("page", (page) => {
page.on("download", (download) => {
console.log("download", download);
});
});
const newPage = await context.newPage();
await newPage.goto(
"https://support.spatialkey.com/spatialkey-sample-csv-data"
);
newPage.on("download", (download) => download.path().then(console.log));
})();
Describe the bug
- When the page loads, click on any of the download links
Expectation:
- See the path of downloaded file as well as complete download object
Current behavior:
- Most of the times I don’t see any logs
- At times I would see logs for
context
based listener - I never see the download path’s promise being resolved. I think it might be because the download size is too small but I would expect it to keep working properly even for small files.
Is there something wrong with my machine? I tried quitting existing chrome installation and reinstalling all packages to no avail. Any suggestion would be helpful, thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:7 (4 by maintainers)
Top Results From Across the Web
5 Working with Agile PLM Events and Event Context Objects
Asynchronous - In this mode, the Event Handler has its own thread (runs independent of the execution of the action taken) and it...
Read more >Release notes for Windows - Zoom Support
Zoom provides up-to-date release notes for our software on devices using Windows. This article contains information about recent changes to the Zoom app...
Read more >Safari Technology Preview Release Notes - Apple Developer
Safari Technology Preview Release 147 is now available for download for macOS ... while also supporting the option of using non-persistent background pages ......
Read more >Realtime Database triggers | Cloud Functions for Firebase
Trigger a Realtime Database function. Set the event handler; Specify the instance and path. Handle event data. Accessing user authentication information ...
Read more >VS Code API | Visual Studio Code Extension API
The function is sometimes also called command handler. ... However, when invoking an editor command not all argument types are supported.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can reproduce it on Windows too.
Hey @rwoll, this helped. Thanks a ton! 😃
I haven’t tried to stop the page from closing but I will try it and update on the status.