获取 gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME

M'B*_*las 4 angularjs cordova firebase ionic-framework firebase-storage

我最近收到此错误消息,不知道为什么。

获取 gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME

以下是我对存储服务的引用:

var storage = firebase.storage();

var storageRef = storage.ref();

var storageRefImgs = storageRef.child('images');
Run Code Online (Sandbox Code Playgroud)

我有谷歌浏览器 51,我正在运行 Windows 10。

Fra*_*len 10

似乎您将gs://URL(这是一个内部 Google 存储引用)放入无法处理它的控件(例如img标签)中。

如果要在img标记中使用该文件,则必须获取该文件的下载 URL。从文档:

storageRef.child('images/stars.jpg').getDownloadURL().then(function(url) {
  // Get the download URL for 'images/stars.jpg'
  // This can be inserted into an <img> tag
  // This can also be downloaded directly
}).catch(function(error) {
  // Handle any errors
});
Run Code Online (Sandbox Code Playgroud)