Skip to content

[BUG] Accept Incoming network connections dialog #910

Closed

Description

@xadvfh

Context:

  • Playwright Version: [what Playwright version do you use?] Tested with 1.19.0, 1.20.1, 1.21.0
  • Operating System: [e.g. Windows, Linux or Mac] Mac Monterey
  • Node.js version: [e.g. 12.22, 14.6] Java
  • Browser: [e.g. All, Chromium, Firefox, WebKit] Chromium
  • Extra: [any specific details about your environment]

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

page.navigate("https://myCompanyUrl.com"
page.waitForTimeout(10000);

Describe the bug

Something in our application is causing the Accept incoming network connections dialog to get triggered. I tried to reproduce on other sites but haven't been able to. I have logs that I gathered via DEBUG=pw:browser*,pw:protocol but would prefer to send them privately.

Activity

  1. yury-s commented on Apr 22, 2022

    @yury-s
    Member

    Can it be that your application is trying to run a web server and that it requires extra permissions from the system? or might be some JVM debugging port? Playwright itself doesn't listen for incoming traffic normally, can you share the code that triggers the dialog?

  2. xadvfh commented on Apr 25, 2022

    @xadvfh
    Author

    Can it be that your application is trying to run a web server and that it requires extra permissions from the system

    Not that I know of.

    Yury Semikhatsky (@yury-s) sent you a slack message with the reproducible snippet.

  3. yury-s commented on Apr 25, 2022

    @yury-s
    Member

    Thanks! I tried that and don't see any dialogs, my hunch is that it is because the VM tries to open debugging port. Try running from terminal, something like this:

    mvn exec:java  -e -Dexec.mainClass=org.example.Bug
    
  4. xadvfh commented on Apr 25, 2022

    @xadvfh
    Author

    Yury Semikhatsky (@yury-s) I still see it when i run mvn exec:java -e -Dexec.mainClass=MainClass. I don't see it on other sites for my company, only a couple of them. I have browser and protocol logs that i'm going to send over slack if you wouldn't mind taking a look. Thank you!

  5. yury-s commented on Apr 25, 2022

    @yury-s
    Member

    Can you post a screenshot of the dialog that you see?

  6. xadvfh commented on Apr 25, 2022

    @xadvfh
    Author

    Sure here you go:
    image

  7. xadvfh commented on Apr 29, 2022

    @xadvfh
    Author

    Yury Semikhatsky (@yury-s) just wanted to see if you were able to learn anything from the logs i sent over slack?

  8. yury-s commented on Apr 29, 2022

    @yury-s
    Member

    I don't see anything unusual there, no network request from the browser. My hunch is that new Chromium might have introduced some feature that requires listening to incoming connections but you are saying that it's happening with older versions too (1.19 etc).

    Do you see this dialog if you run Chromium without Playwright from terminal like below?

    /Users/xadvfh/Library/Caches/ms-playwright/chromium-1000/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --enable-use-zoom-for-dsf=false --no-sandbox --user-data-dir=/var/folders/14/d7mnwcns4tggtvrw3jym4tn80000gp/T/playwright_chromiumdev_profile-qWfh5p
    
  9. xadvfh commented on Apr 29, 2022

    @xadvfh
    Author

    Yury Semikhatsky (@yury-s) yes I can see the dialog when running without playwright using the command you linked

  10. yury-s commented on Apr 29, 2022

    @yury-s
    Member

    Well, that's definitely a Chromium issue then, I believe all the flags we pass should not matter, you can try with the shorter command line and see the same dialog:

    /Users/xadvfh/Library/Caches/ms-playwright/chromium-1000/chrome-mac/Chromium.app/Contents/MacOS/Chromium --no-sandbox --user-data-dir=/tmp/your-profile
    

    It probably has something todo with security settings on your Mac, do you know if this dialog comes from an anti-virus (looks like a system one but want to double check)? The problem is I can't reproduce it to give you an advice.

  11. yury-s commented on Apr 29, 2022

    @yury-s
    Member

    Andrey Lushnikov (@aslushnikov) pointed out that he was fixing similar issue a year ago in microsoft/playwright#8162 and it looks like the feature flag was renamed to DialMediaRouteProvider, we'll update the flags that we pass to Chromium by default.

    Can you confirm that adding the new flag fixes the problem for you (try replacing MediaRouter with DialMediaRouteProvider in the command line above, you can also do it for the browser in playwright using a combination of setIgnoreDefaultArgs and setArgs)?

  12. xadvfh commented on Apr 29, 2022

    @xadvfh
    Author

    Yury Semikhatsky (@yury-s) using the short command /Users/umairchagani/Library/Caches/ms-playwright/chromium-1000/chrome-mac/Chromium.app/Contents/MacOS/Chromium --no-sandbox --user-data-dir=/tmp/your-profile I see the dialog right away without even navigating to any page.

    Adding in DialMediaRouteProvider to the --disabled-features flag still shows the dialog.

    I also tried this on a personal computer and did NOT see the dialog. so it must be the work computer. i guess i'll try digging around. is it expected to not see it headless but only when headful?

  13. yury-s commented on Apr 29, 2022

    @yury-s
    Member

    is it expected to not see it headless but only when headful?

    Yes, the feature is not available in headless.

  14. yury-s commented on May 13, 2022

    @yury-s
    Member

    xadvfh can you check if it still reproduces with the new release 1.22.0 ?

  15. yury-s commented on May 18, 2022

    @yury-s
    Member

    It should be fixed by microsoft/playwright#13854, please file a new issue if it still reproduces on v1.22.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions