Hello Monks, I'm running strawberry perl and I can't control Chrome from perl, it connects to Chrome and opens a new "about:blank" tab but then gives an error

can't connect without knowing the port?! 0 at C:/Strawberry/perl/site/lib/Chrome/DevToolsProtocol.pm line 317.

I launched Chrome with --remote-debugging-port-9222, and set the options in perl code

my $mech = WWW::Mechanize::Chrome->new(port => 9222);

but on $TRACE I get below.

2021/06/06 10:12:39 Spawning $VAR1 = [ 'C:\\Users\\Maany\\AppData\\Local\\Google\\Chrome\\Applicati +on\\chrome.exe', '--v=0', '--remote-debugging-port=0', '--enable-automation', '--no-first-run', '--mute-audio', '--no-zygote', '--no-sandbox', '--safebrowsing-disable-auto-update', '--disable-background-networking', '--disable-breakpad', '--disable-client-side-phishing-detection', '--disable-component-update', '--disable-hang-monitor', '--disable-prompt-on-repost', '--disable-sync', '--disable-translate', '--disable-web-resources', '--disable-default-apps', '--disable-infobars', '--disable-popup-blocking', '--disable-gpu', '--disable-save-password-bubble', 'about:blank' ];

so port is not set, have tried :

#!perl use strict; use WWW::Mechanize::Chrome; $ENV{WWW_MECHANIZE_CHROME_CONNECTION_STYLE}='pipe'; my $mech = WWW::Mechanize::Chrome::->new();


but I got below error

Only websocket communication is supported on MSWin32, not 'pipe'

any help please ?

In reply to can't connect without knowing the port?! 0 www::mechanize::chrome by Maany

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.