Fetch API cannot load ... But ONLY ios Safari and ONLY on HTTPS?

I’ve been using a fetch script in order to handle adding and reacting to alert messages to the client for things like a “We use cookies” notification that then sets a cookie when the visitor clicks the accept button. It’s been working great in all tested browsers and mobile systems EXCEPT now that I’ve added it to a secure site it won’t work on ios safari.

Does anyone have any clue why this fetch should cause an error ONLY in ios safari? Safari on the Mac doesn’t even have an issue

This is what I get:
Fetch API cannot load https://site.com/FILEpath/filename.php

The acknowledge button is using this:

function addFetch(event, targetBlock, domain)
  const form = new FormData(event.target);
  const request = new Request(event.target.action,
    method: event.target.method,
    body: form,
    mode: 'same-origin',
    credentials: 'same-origin'
  .then(response => response.text())
  .then(text => document.getElementById(targetBlock).innerHTML = text)
  .catch(error => console.log('There was an error:', error))

And the kicker is that the code works perfectly in it’s exact structure on another test site where the one and only difference is it is not secure (http instead of https)

You posted over the weekend…and it’s a relatively obscure use case, so there might not be a lot of people who would know how to handle it. I get you’re frustrated, but comments like that aren’t necessary, not helpful in getting people to look at your issue.

That being said, are you calling this from a non-ssl site? If so, quick searches state that IOS safari doesn’t allow switching from http to https in javascript.

Or it could be a cookie issue: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

It’s same source (https requesting to https exact same URL both SSL) will look at the cookies issues you linked but there’s only one in use at the point where the problem occurs and that’s the session.

It can be seen on the landing page of my site foliographic.com and what works fine in every browser I’ve tested can be seen clearly failing when you try to accept the cookies button on an iphone or ipad at the same URL.

It’s the problem that is preventing the button that would set a cookie ironically to acknowledge the use of cookies… The error I see in the console doesn’t even say why, just that it can’t: (File path is placeholder not actual in this error message but the error is exactly this except for the actual URL it shows)

Fetch API cannot load https://example.com/FILEpath/filename.php

I don’t have access to an ipad/iphone device at the moment.

There should be more to the error you’re getting but everything points to either a cookie issue or a server configuration (at least when I search for “FetchAPI cannot load” and “IOS Safari”)