In a bucket you can change cross policy https://cloud.google.com/storage/docs/cross-origin I followed this steps:
In gsutil: First I removed the read permisions from allUsers that I configured at first
gsutil iam ch -d allUsers gs:/myBucketName
I removed it because even if I configured the json to serve only on localhost:8080, it serves content from other ports. Then I configure with gsutil as pointed out here https://cloud.google.com/storage/docs/configuring-cors this json options:
[{ "origin":["http://localhost:8080"],
"responseHeader":["Content-Type"],
"method":["GET"],
"maxAgeSeconds":0
}]
In gsutil:
gsutil cors set cor.json gs://myBucketName
After that, I´m using a simple html and a local server that only have this content:
<html>
<body>
<img src="linkfrombyObject">
</body>
</html>
But I when my broser try to fetch the image, It gets and xml that says:"Anonymous caller does not have storage.objects.get