leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
445 stars 21 forks source link

change rt.jar.com.js code to include no-cors #134

Closed gl91306 closed 2 years ago

gl91306 commented 2 years ago

most cors errors can be fixed by changing this bit of code in rt.jar.com.js fetch(path, { method: jsMethod, body: postData, headers: myHeaders }).then(function(response) { ...... to fetch(path, { method: jsMethod, mode: 'no-cors', body: postData, headers: myHeaders }).then(function(response) { ......

alexp-sssup commented 2 years ago

I think you might be misunderstanding with mode: "no-cors" does. Please read this: https://stackoverflow.com/questions/43262121/trying-to-use-fetch-and-pass-in-mode-no-cors

CORS is a security feature, it cannot be disabled from client side code, by design.