MobileChromeApps / mobile-chrome-apps

Chrome apps on Android and iOS
BSD 3-Clause "New" or "Revised" License
2.5k stars 347 forks source link

Content Security Policy media-src problem #608

Closed Elevista closed 7 years ago

Elevista commented 8 years ago

Can not apply blob url to video src tag

navigator.getUserMedia(constraints, function(stream) {
    var videoElm = document.querySelector('video');
    var blobUrl = URL.createObjectURL(stream);
    videoElm.src = blobUrl;  //CSP ERROR
});

ERROR:

Refused to load media from 'blob:file%3A///203d97fa-866a-4e5d-aeeb-b8998e178ebc' because it violates the following Content Security Policy directive: "media-src *".

default media-src CSP has not "blob:" protocol

There is no "content_security_policy" field in Chrome app manifest.json to set CSP https://developer.chrome.com/apps/manifest How can I override media-src CSP?

version: Chrome/49.0.2623.112 Crosswalk/19.49.514.5

Elevista commented 8 years ago

I found answer from closed issues, but where can I get the full manifest.mobile.json API?