question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Download event not fired when launched with persistent context

See original GitHub issue

Context:

  • 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yury-scommented, Jul 24, 2020

Can reproduce it on Windows too.

1reaction
VikramTiwaricommented, Aug 7, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found