0
我有一個iframe
一個twig
文件中,顯示一個pdf
文件中像這樣的內容:替代的絕對URL時加載資產(不安全的資源)
<iframe src="https://docs.google.com/gview?url={{ absolute_url(asset('bundles/path/to/file.pdf')) }}&embedded=true"></iframe>
但打開的iframe時,Chrome就會顯示此錯誤消息:
Mixed Content: The page at 'https://website.com/home#pdf' was loaded over HTTPS, but requested an insecure resource 'http://docs.google.com/gview?url=pdf/url?v2249&embedded=true'. This request has been blocked; the content must be served over HTTPS.
還有什麼其他選項可以使用?
這個怎麼樣部分:'的https:/ /docs.google.com/gview?url='?我是否保留在{{}}之前? –
是的,你必須保留它 - 我會更新答案。 –
這仍然給我一個'GET http:// localhost:35729/livereload.js net :: ERR_CONNECTION_REFUSED',並且在iframe中,我得到一個「無法預覽avaible」消息 –