Skip to content

Commit b0452a7

Browse files
committed
don't expect Chromium to listen on 0.0.0.0 (see #72845)
`--remote-debugging-address` was removed in Chromium 126+
1 parent 3e69fe6 commit b0452a7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

html2pdf/chrome.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (pw *proxyWriter) Write(data []byte) (n int, err error) {
3232
if err == nil && pw.portCh != nil {
3333
pw.data = append(pw.data, data...)
3434
s := string(pw.data)
35-
re := regexp.MustCompile(`DevTools listening on ws://0\.0\.0\.0:([0-9]+)`)
35+
re := regexp.MustCompile(`DevTools listening on ws://[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:([0-9]+)`)
3636
matches := re.FindAllStringSubmatch(s, -1)
3737
if len(matches) > 0 {
3838
port, _ := strconv.Atoi(matches[0][1])
@@ -53,7 +53,6 @@ func startChrome(ctx context.Context, prog string) (port int, process *os.Proces
5353
"--headless",
5454
"--disable-gpu",
5555
"--no-sandbox",
56-
"--remote-debugging-address=0.0.0.0",
5756
"--remote-debugging-port=0",
5857
)
5958
wg := sync.WaitGroup{}

0 commit comments

Comments
 (0)