filepicker.io Javascript API calls result in unsafe javascript errors

淺唱寂寞╮ 提交于 2019-12-01 21:15:26

问题


I'm currently using AngularJS, and I would like to call filePicker.pickAndStore from my Upload controller. Any call to a filepicker.io API function results in an "Unsafe Javascript attempt" error:

The frame requesting access has a protocol of 'https', the frame being accessed has a > protocol of 'http'. Procols must match.

Javascript

angular.module('app').controller('UploadCtrl', ['$scope, function ($scope) {
    $scope.uploadFiles = function() {
        filepicker.pickAndStore({mimetype:'image/*'},{},function(files){console.log(files)},function(err){console.log(err)});
    }
}]);

HTML:

<button type="button" ng-click="uploadFiles()">Upload</button>

The error displays in the console as soon as I click the button and the filepicker modal shows up.

I can still select and upload files, but I don't know why this error should occur since I am including the http filepicker source in my project.

Thank you for any help you can provide.


回答1:


This is a known chrome/webkit issue. This is happening on any cross domain iframe that adds a flash tag to itself through JavaScript (technique used by filepicker).

Last news from filepicker team: They are working on circumventing this.



来源:https://stackoverflow.com/questions/15192466/filepicker-io-javascript-api-calls-result-in-unsafe-javascript-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!