简体   繁体   English

Delphi 10.2 中的 TWebBrowser 未显示应有的表单

[英]TWebBrowser in Delphi 10.2 doesn't show a form as it should

I make a multi-device app that has a TWebBrowser component.我制作了一个具有 TWebBrowser 组件的多设备应用程序。 If i write this code如果我写这段代码

WebBrowser1.Navigate('https://google.com');

it opens the form as it should be.它按原样打开表单。 But if i write this code但是如果我写这段代码

WebBrowser1.Navigate(edit1.text);

where edit1.text=the URL of a GoogleForms form (= https://docs.google.com/forms/d/e/1FAIpQLScLDCv_LeYJzvMoxnmvt_gN_gqeup7_vbU8VLaC-qXNPEGMIQ/viewform?vc=0&c=0&w=1&fbzx=3551763952707733753 ), it shows the form confused (the dropdown components as list of text, the "submit" button as text etc) like this :其中 edit1.text=GoogleForms 表单的 URL(= https://docs.google.com/forms/d/e/1FAIpQLScLDCv_LeYJzvMoxnmvt_gN_gqeup7_vbU8VLaC-qXNPEGMIQ/viewform?vc=0&c=0&w=1&fb75x37 ),它显示了表单 735517x37困惑(下拉组件作为文本列表,“提交”按钮作为文本等)像这样:

在此处输入图片说明

is there a solution, please ?请问有解决办法吗?

PS.附注。 the form is opened in Internet Explorer (and Google) right.该表单是在 Internet Explorer(和 Google)中打开的。

The reason why this happens is that by default TWebBrowser component is opening web pages in compatiblity mode.发生这种情况的原因是默认情况下 TWebBrowser 组件以兼容模式打开网页。 This prevents myn moder web pages to show properly.这会阻止我的现代网页正确显示。

So in order to avoid this you need to opt in to the browser emulation feature using the documented registry key.因此,为了避免这种情况,您需要使用记录的注册表项选择加入浏览器模拟功能。

You can find more info about this on the link bellow您可以在下面的链接中找到有关此的更多信息
https://stackoverflow.com/a/25843958/3636228 https://stackoverflow.com/a/25843958/3636228

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM