Hi all, one more problem comes with CORS policy
I load tokens :
const tokens_from_moralis = await Moralis.Web3API.account.getTokenBalances();
I get for example 1 token:
- balance: “758843916378527162757”
- decimals: “18”
- logo: “https://cdn.moralis.io/eth/0xf4d861575ecc9493420a3f5a14f85b13f0b50eb3.png”
- name: “Fractal Protocol Token”
- symbol: “FCL”
- thumbnail: “https://cdn.moralis.io/eth/0xf4d861575ecc9493420a3f5a14f85b13f0b50eb3_thumb.png”
then using thumbnail:
var empTable = document.getElementById('token_table_dyn');
var tr = empTable.insertRow(-1);
for (var h = 0; h < arrHead.length; h++) {
if (h == 0) {
var th = document.createElement('th'); // create table headers
th.innerHTML = "<img src="+arrHead[h]+">"; // insert image dynamically
tr.appendChild(th);
} else {
var th = document.createElement('th'); // create table headers
th.innerHTML = arrHead[h]; // insert the rest of token info
tr.appendChild(th);
}
}
here is piece of table creation:
th.innerHTML ="<img src="+arrHead[h]+">; // insert image dynamically
whete arrHead[h] = thumbnail link
result:
GET https://cdn.moralis.io/eth/0xf4d861575ecc9493420a3f5a14f85b13f0b50eb3_thumb.png net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep
of course using the link allows to see it in browser but CORS policy on server for this resource doesn’t allow to load it by localhost
any ideas beside changing CORS policy on server?