Hello, we wanted to perform some actions when add to cart and remove from cart events are performed and hence we have added listeners for XMLHttpRequest and when an api call is made for the above events, we are performing some actions. This was working fine some time back and suddenly it stopped working and when debugged, we found that shopify has changed the implementation from using XMLHttpRequest to using fetch for making an api call.
We tried to change the code from assets folder(through edit code) to use XMLHttpRequest instead of fetch but the api is returning 302 status when using XMLHttpRequest to make the api call. Is there any change that we can do so that we can use XMLHttpRequest instead of fetch?
Also, we noticed in couple of stores, Shopify is using XMLHttpRequest and in some stores, it is using fetch for making the api calls for the same events. We couldn’t find any documentation around why Shopify is using different api calls?