|
|
|
@ -17,8 +17,11 @@ import com.teamdev.jxbrowser.engine.EngineOptions;
|
|
|
|
|
import com.teamdev.jxbrowser.engine.RenderingMode; |
|
|
|
|
import com.teamdev.jxbrowser.event.Observer; |
|
|
|
|
import com.teamdev.jxbrowser.js.JsObject; |
|
|
|
|
import com.teamdev.jxbrowser.net.Network; |
|
|
|
|
import com.teamdev.jxbrowser.net.Scheme; |
|
|
|
|
import com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback; |
|
|
|
|
import com.teamdev.jxbrowser.view.swing.BrowserView; |
|
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
@ -108,6 +111,17 @@ public class NewModernUIPane<T> extends ModernUIPane<T> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Engine engine = Engine.newInstance(builder.build()); |
|
|
|
|
if (DesignerEnvManager.getEnvManager().isOpenDebug()) { |
|
|
|
|
// 调试模式下,禁止HTTPS证书验证,使得可以正常访问商城测试服务器等
|
|
|
|
|
Network network = engine.network(); |
|
|
|
|
network.set(VerifyCertificateCallback.class, new VerifyCertificateCallback() { |
|
|
|
|
@Nullable |
|
|
|
|
@Override |
|
|
|
|
public Response on(Params params) { |
|
|
|
|
return VerifyCertificateCallback.Response.valid(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
browser = engine.newBrowser(); |
|
|
|
|
|
|
|
|
|
// 初始化的时候,就把命名空间对象初始化好,确保window.a.b.c("a.b.c"为命名空间)对象都是初始化过的
|
|
|
|
|