diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index e4422f7a57..37b63aa971 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -52,6 +52,9 @@ jobs: - os: ubuntu-latest browser: Edge extra_flags: "--use-xvfb" + - os: ubuntu-latest + browser: Chrome-38 + extra_flags: "--use-xvfb --no-drm" - os: macos-latest browser: Chrome @@ -100,6 +103,17 @@ jobs: sudo dpkg -i microsoft-edge-stable_108.0.1462.46-1_amd64.deb fi + - name: Install Chrome 38 + if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Chrome-38' + run: | + # sudo apt-get update + # sudo apt-get remove google-chrome-stable + # Chrome 38 it's a old version included in WebOS 3.0 + # (the oldest device that we support). + wget "https://storage.googleapis.com/old-browsers/google-chrome-38.deb" + sudo dpkg -i "google-chrome-38.deb" + sudo ln -sf /usr/bin/google-chrome-38 /usr/bin/google-chrome + - name: Checkout code uses: actions/checkout@v3 with: @@ -140,6 +154,10 @@ jobs: run: | browser=${{ matrix.browser }} + if [[ "$browser" == "Chrome-38" ]]; then + browser="Chrome" + fi + if [[ "$browser" == "Safari-old" ]]; then # Replace the browser name with a script that can launch this # browser from the command line. diff --git a/lib/net/http_fetch_plugin.js b/lib/net/http_fetch_plugin.js index b5320258c6..32f1d0101a 100644 --- a/lib/net/http_fetch_plugin.js +++ b/lib/net/http_fetch_plugin.js @@ -243,6 +243,16 @@ shaka.net.HttpFetchPlugin = class { } else { return false; } + // Old fetch implementations hasn't body and ReadableStream implementation + // See: https://github.com/shaka-project/shaka-player/issues/5088 + if (window.Response) { + // eslint-disable-next-line no-restricted-syntax, no-prototype-builtins + if (!Response.prototype.hasOwnProperty('body')) { + return false; + } + } else { + return false; + } return !!(window.fetch && window.AbortController); } };