diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17b72f44..82efff99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v3 with: - go-version: ~1.20.4 + go-version: ~1.20.6 - uses: actions/cache@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29a7f01a..9ed19d38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v3 with: - go-version: ~1.20.4 + go-version: ~1.20.6 - uses: actions/cache@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 545ad8d1..073b4510 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v3 with: - go-version: ~1.20.4 + go-version: ~1.20.6 - uses: actions/cache@v3 with: diff --git a/selenoid.go b/selenoid.go index 1f9a2ee2..1987d387 100644 --- a/selenoid.go +++ b/selenoid.go @@ -413,12 +413,19 @@ func processBody(input []byte, host string) ([]byte, string, error) { if err != nil { return nil, sessionId, fmt.Errorf("parse body response: %v", err) } - if raw, ok := body["value"]; ok { - if v, ok := raw.(map[string]interface{}); ok { - if raw, ok := v["capabilities"]; ok { - if c, ok := raw.(map[string]interface{}); ok { - sessionId = v["sessionId"].(string) - c["se:cdp"] = fmt.Sprintf("ws://%s/devtools/%s/", host, sessionId) + // handle jsonwp response from older browsers (chrome < 75) + if rawId, ok := body["sessionId"]; ok { + if si, ok := rawId.(string); ok { + sessionId = si + } + } else { + if raw, ok := body["value"]; ok { + if v, ok := raw.(map[string]interface{}); ok { + if raw, ok := v["capabilities"]; ok { + if c, ok := raw.(map[string]interface{}); ok { + sessionId = v["sessionId"].(string) + c["se:cdp"] = fmt.Sprintf("ws://%s/devtools/%s/", host, sessionId) + } } } }