Hello Everyone, I hope you are doing well.
I`m trying to intercept requests in Dynamics365 using the MSWJS library.
I would be very grateful if anyone did smth similar and could suggest if it is possible to register a Service Worker and intercept requests in D365.
It`s what I did (I succeeded to intercept a request from HTML WebResource but can`t intercept a request from JavaScript WebResource):
I uploaded as WebResources 4 separate files:
- mockServiceWorker.js
- JS file (packed with webpack), which registers mockServiceWorker and my handlers. And also register the simple react app for the next HTML web resource.
- HTML file.
- another JavaScript file that will just make requests on form events.
I added HTML WebResource to the form. It references the file that registers the ServiceWorker like this:
On the form on load, I have in the Console the following message:
[MSW] Mocking enabled. Documentation: https://mswjs.io/docs Found an issue? https://github.com/mswjs/msw/issues Worker script URL: https://org___crm.dynamics.com/%7b638496017200000228%7d/webresources/publisher_mockServiceWorker.js Worker scope: https://org6eb79fb6.crm.dynamics.com/%7b638496017200000228%7d/webresources/
But when I try to make the same request from another JavaScript WebResource - it doesn`t.
Could you tell me please if anyone ever tried to integrate Dynamics 365 with Service Worker and suggest how to do this? Is it possible to integrate MSW with Dynamics 365?
How do I need to register ServiceWorker to make it intercept requests from my JS WebResources? (Ideally not only from JS Web Resources but for this I will need to register it in the root. And I think it`s not possible in D365)
Thank you in advance


Report
All responses (
Answers (