Open BenjaminLiCN opened 1 year ago
According to this article, it is because my request is generated from lightning.force.com which is the same as LWC. The api hostname ends with salesforce.com. And since they are not the same origin hence the request fails. What I couldn't understand is why is Inspector capable of making calls from salesforce.com????? I didn't see any secret in the inspector.js code.
So in safari extension I only have one file named script.js which is lilke background.js. It can send data to Swfit code and display them.
This is executed in my sandbox hostname ends with "lightning.force.com", however I observed the request will be redirected to another ends with "my.salesforce.com". I suspect this is why it blocks my request. Anyone can directly copy this code and run in chrome console.
Could anyone shed some light, please? First image is the successful request sent by inspector extension on chrome.
Second is my code executed on chrome console