【发布时间】:2016-03-09 01:35:12
【问题描述】:
我正在尝试加载要在 webview 上显示的 URL (http://twitch.tv/directory/following)。它曾经完美地反映了我在 Google Chrome 中看到的内容。一路走来,它开始阻止页面中的图像,我一直收到错误
Mixed Content: The page at 'https://www.twitch.tv/directory/following' was loaded over HTTPS, but requested an insecure image 'http://static-cdn.jtvnw.net/ttv-boxart/Music-138x190.jpg'. This request has been blocked; the content must be served over HTTPS.
对于每个尝试加载的图像。我在 Chrome 中对此进行了检查,我收到了相同的消息,但将其列为警告,因为图像仍在通过。我尝试禁用 BrowserWindow 中的安全设置:
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
'title-bar-style': 'hidden',
frame : false,
webPreferences : {
webSecurity: false,
allowDisplayingInsecureContent: true
}
});
但无济于事,因为它仍然会阻止图像。有任何想法吗?谢谢。
【问题讨论】:
标签: javascript google-chrome electron mixed-content