问题
I can't seem to get a Vaadin(7) BrowserFrame to open https sources, and am struggling to understand why that might be. With http:// sources the web page is opened just fine, but I just get a blank page when using a https://www.google.co.uk; tcpdump shows that the a request was served, but it's not displayed in the browser window.
class BrowserWindow extends Window {
BrowserWindow(URI externalUri) {
center()
setClosable(false)
setDraggable(false)
setResizable(false)
setSizeFull()
setModal(true)
def ex = new ExternalResource(externalUri.toString())
BrowserFrame browser = new BrowserFrame("Browser", ex)
browser.setSizeFull()
content = browser
}
}
It works just fine with
getUI().getCurrent().addWindow(new BrowserWindow("http://www.truespeed.com")
but not with
getUI().getCurrent().addWindow(new BrowserWindow("https://www.google.co.uk")
Does anyone know why that might be?
回答1:
This is usually a problem caused by mixed (https and http) content. The BrowserWindow might be trying to load an http page / resource which is "Potentially Dangerous". If you open the browser console, you will be able to see the error because of which the content was not loaded.
In short: If a https parent window tried to load a resource over http which compromises the security of the entire page, the browser can/will not load that resource.
More detailed information about mixed content can be found here
Make sure that the resource you are trying to load uses https to get around that problem (if mixed content is the problem).
来源:https://stackoverflow.com/questions/36135226/vaadin-browserframe-not-displaying-https-sources