I develop a web app with rails 3.2, turbolinks and Filepicker.io
I loade the API key like this (coffeescript). I think $(document).ready
is enough, as the filepicker script get loaded once on the first request.
$(document).ready ->
filepicker.setKey "MY_KEY"
I load Filepicker with the following (coffeescript).
I should note that I use the jquery-turbolinks
gem, which builds the support for turbolinks right into jquery.
jQuery ->
$("#publications_bulk-new #upload-button").on "click", ->
form = $(this).closest('form')
filepicker.pickAndStore
When I visit the page directly, filepicker works as expected. However, when I visit the page using a turbolink request I cant upload any file.
I can open the form, browse in Dropbox etc. But When Uploading, I see the following error message in red:
Cannot send results to the applicaiton. Sorry about this, it's our fault. Please close this window and try again.
Trying again does not help.
I checked the console of Chrome 28.0 for any error messages and found this:
Blocked a frame with origin "https://www.filepicker.io" from accessing a frame with origin "http://placeholder.library.dev". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
main.js:7
u main.js:7
l main.js:7
i.uploadFiles main.js:7
v.onFileDrop main.js:7
r lodash.min.js:6
(anonymous function) main.js:7
Uncaught Communication iframe not found main.js:7
u main.js:7
l main.js:7
i.uploadFiles main.js:7
v.onFileDrop main.js:7
r lodash.min.js:6
(anonymous function)
Update 2013-07-29 "Protocols, domains, and ports must match"
I pushed the current code to my production environment, as the message suggests this depends on the missing SSL encryption of my (development) page.
Unfortunately, this is not the only problem
Blocked a frame with origin "https://www.filepicker.io" from accessing a frame with origin "https://jkreutz.mylibrar.io". Protocols, domains, and ports must match. main.js:7
u main.js:7
l main.js:7
i.uploadFiles main.js:7
v.onFileDrop main.js:7
r lodash.min.js:6
(anonymous function) main.js:7
Uncaught Communication iframe not found main.js:7
u main.js:7
l main.js:7
i.uploadFiles main.js:7
v.onFileDrop main.js:7
r lodash.min.js:6
(anonymous function)