Open camelaissani opened 7 years ago
It looks like there is a limitation with Synchronous XHR requests https://stackoverflow.com/questions/35879844/can-service-workers-respond-to-synchronous-xhr-requests
Another cons point:
Service workers only run over HTTPS, for security reasons. Having modified network requests wide open to man in the middle attacks would be really bad. In Firefox, Service Worker APIs are also hidden and cannot be used when the user is in private browsing mode.
from: https://developer.mozilla.org/en/docs/Web/API/Service_Worker_API
Currently these methods application.http(Get|Post...)(request, success, failure) are provided to make AJAX calls. Unfortunately, those methods force developers to use a custom API for making AJAX calls rather than using the standard ones (Fetch, XHR).
May be a solution to avoid this situation is to use the Service Workers? As the SW can play the role of proxy, we can relay on it to listen requests emitted by the application. Thus, the AJAX requests can be invoked from any frameworks (standard JS API, JQuery...) rather than using the ones provided by FrontExpress.