Script don't work in Chrome, but works in preview and test on Chrome. (SSL handshake failed)

I’m trying out some different ways to connect to external API’s, like the Cat API and Httpbin…

But on Chrome Version 67.0.3396.99 (MacOS), i keep getting a request-loop - hundreds of requests until i close the tab.

Every time with the error: SSL handshake failed

The scripts i tried:

addEventListener('fetch', event => {

  // This handler is for /cats only.
  let url = new URL(event.request.url)
  if (url.pathname.startsWith("/cats")) {
  } else {

async function getCats(request) {

  let url = ''
  let headers = {
    'Content-Type': 'application/x-www-form-urlencoded'

  const init = {
    method: 'GET',
    headers: headers
  const response = await fetch(url, init)
  console.log('Got response', response)
  return response



addEventListener('fetch', event => {

async function fetchAndApply(request) {
  const response = await fetch('')
  const modifiedHeaders = new Headers(response.headers)

  modifiedHeaders.set('Content-Type', 'text/xml')

  const init = {
    status: response.status,
    statusText: response.statusText,
    headers: modifiedHeaders
  const modifiedResponse = new Response(response.body, init)
  return modifiedResponse

Nevermind, had to set SSL setting to “Full” for it to work.