N
N
Nadim Zakirov2020-06-29 18:36:05
JavaScript
Nadim Zakirov, 2020-06-29 18:36:05

How to disable CORS header checking in Apache Cordova application?

Can I upload an image as a Blob in my application without using a proxy to add Access-Control-Allow-Origin ? My intuition tells me that perhaps Cordova provides ways to disable security mechanisms.

fetch('https://site.ru/img.png')
.then(function(response) { return response.blob(); })
.then(function(blob) {
  var image = document.createElement('img');
  var url = URL.createObjectURL(blob);
  image.setAttribute('src', url);
  document.body.appendChild(image);
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question