DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: laidabin
今日帖子: 1
在线用户: 3
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 zhouying (zy) ★☆☆☆☆ -
盒子活跃会员
2022/5/7 21:54:45
标题:
是不是10.4版本中Webbrowser的bug 浏览:1615
加入我的收藏
楼主: 看到了新的Webbrowser控件里面有个SelectedEngine的属性,选择了EdgeifOnly.
但是实际再win11打开网页的时候,依然还是显示的跟ie11一样,而且我设置的部分CSS好像也并未实现,我用的是 img{width:100px; height:200px}

这个具体是什么原因呢?有兄弟么知道吗
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/5/7 23:03:08
1楼: RAD 11 

Edge SDK is installed in target PC?  or a DLL to EDGE?

----------
SHDocVW.pas

... line 3591

  procedure DoCreate;
  begin
    // Create the IE control or the Edge control according to the property
    case FSelectedEngine of
      TSelectedEngine.IEOnly:
      begin
        FIEIntf := IUnknown(OleObject) as IWebBrowser2;
        FActiveEngine := TActiveEngine.IE;
      end;
      TSelectedEngine.EdgeOnly,    /// <<----------
      TSelectedEngine.EdgeIfAvailable:
      begin
        // Indicate we are on the case to avoid another call into here starting us off again
        FActiveEngine := TActiveEngine.NoneYet;
        FEdgeReadyState := READYSTATE_LOADING;
        // Set forth trying to create a WebView2 browser control
        if FEdge = nil then
          FEdge := TEdgeBrowser.Create(Self);
        FEdge.OnCreateWebViewCompleted := WebViewCreateWebViewCompleted;
        FEdge.OnDocumentTitleChanged := WebViewDocumentTitleChanged;
        FEdge.OnHistoryChanged := WebViewHistoryChanged;
        FEdge.OnNavigationStarting := WebViewNavigationStarting;
        FEdge.OnNavigationCompleted := WebViewNavigationCompleted;
        FEdge.OnNewWindowRequested := WebViewNewWindowRequested;
        FEdge.OnScriptDialogOpening := WebViewScriptDialogOpening;
        FEdge.Width := Width;
        FEdge.Height := Height;
        FEdge.Parent := Self;
      end;
    end;
  end;

begin
  if (FIEIntf = nil) and
     ((FEdge = nil) or not FEdge.WebViewCreated) and
     (FActiveEngine <> TActiveEngine.NoneYet) then
    DoCreate;
end;

... more in  line 4328
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 iamdream (银河恒久远,梦想无止境!) ★☆☆☆☆ -
大贡献会员
2022/5/8 9:22:26
2楼: 你需要安装WebView2运行库。
----------------------------------------------
-广袤璀璨的银河,永无止境的梦想(梦无止境游银河) 博客挂了……
作者:
男 zhouying (zy) ★☆☆☆☆ -
盒子活跃会员
2022/5/8 12:36:25
3楼: 我在程序的目录下放了WebView2Loader.dll; Microsoft.Web.WebView2.Core.dll
2个文件了,还不行啊,那要这么复杂的话,我直接选个TEdge控件好了。一样不是也要运行环境的
----------------------------------------------
-
作者:
男 keymark (嬲) ▲▲▲△△ -
普通会员
2022/5/8 15:12:49
4楼: https://developer.microsoft.com/zh-cn/microsoft-edge/webview2/

WebView2 应用可以在以下版本的 Windows 上运行:

Windows 11
Windows 10
Windows 10 IoT 企业版 LTSC x32 2019
Windows 10 IoT 企业版 LTSC x64 2019
Windows 10 IoT 企业版 21h1 x64
Windows 8.1
Windows 7 **
Windows Server 2019
Windows Server 2016
Windows Server 2012
Windows Server 2012 R2
Windows Server 2008 R2 **
----------------------------------------------
[alias]  co = clone --recurse-submodules  up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
作者:
男 zhouying (zy) ★☆☆☆☆ -
盒子活跃会员
2022/5/8 21:59:48
5楼: 难道我还要求客户端装了100多M的安装包啊,如果单独加载某个dll文件不行吗?
----------------------------------------------
-
作者:
男 vkow (vkow) ★☆☆☆☆ -
普通会员
2022/5/8 22:11:55
6楼: 之前稍微研究过WebView2。后来就搁置了。
提醒大家一下,不知道现在是否还是如此。

WebView2Loader.dll是和Edge版本有对应关系的。
然而,Edge具有自动升级功能。
那就会出现这种情况:
以后有一天,程序员发布的WebView2与用户的Edge不兼容。需要再次更新WebView2。是不是很烦人。
----------------------------------------------
-
作者:
男 tuesdays (Tuesday) ▲▲▲▲△ -
普通会员
2022/5/8 22:12:20
6楼: 1: 必须安装edge dev
2: 必须带dll.
3: 尽量不要使用此控件.
----------------------------------------------
delphi界写python最强, python界写delphi最强. 写自己的代码, 让别人去运行.
作者:
男 zhouying (zy) ★☆☆☆☆ -
盒子活跃会员
2022/5/8 22:25:00
7楼: 星期二同学,那我如果用TEdge控件也是一样的对吧,是不是要带webview2loader.dll的控件,网上说的都听不太懂
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/5/9 0:35:42
8楼: In fact, you do not need to "Deploy" the libraries of Edge (WebView2Loader...), however, it is necessary that the user has Edge installed on the target computer.

In your software you just check whether or not you want to use:
-- Edge only
-- Use Edge if it is installed
-- or, use IE.

How you do it?

   case WebBrowser1.SelectedEngine of
     TWebBrowser.TSelectedEngine.EdgeOnly:
       ; // code... 
     TWebBrowser.TSelectedEngine.EdgeIfAvailable:
       ; // code...
     TWebBrowser.TSelectedEngine.IEOnly:
       ; // code...
   end;

If Edge is properly installed on the user's computer, it will be used. Otherwise, IE (or another installed) will be used.

This way, you don't have to worry about browser updates on the user's computer.

That's how it should be.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 tuesdays (Tuesday) ▲▲▲▲△ -
普通会员
2022/5/9 14:04:21
9楼: @zhouying 
有任何疑问请看第3点.  永远选择第3点就没错.
----------------------------------------------
delphi界写python最强, python界写delphi最强. 写自己的代码, 让别人去运行.
作者:
男 whesss (whesss) ▲▲▲▲△ -
普通会员
2022/5/9 14:36:48
10楼: 特別上來回這篇!
因為IE快要停止維護了 我們公司也都改為Edge核心
我們研究了一下
win11 不用在安裝sdk 即可直接使用  當然還是需要那兩個dll

win11 以下 除了安裝sdk 
也可以安裝office 365版本 也有內建webview2 sdk

另外 安裝了webview2 sdk 後 電腦是不需要安裝edge的  所以應該跟edge版本沒關係
我有在server 2008 R2 的主機測試過是沒有問題的
----------------------------------------------
-
作者:
男 vkow (vkow) ★☆☆☆☆ -
普通会员
2022/5/9 19:06:40
11楼: 你还不信。那时候明明可以直接调用系统edge运行起来的。

那时候搞完就放着了。搁置到现在,已经无法运行。
此帖子包含附件:
JPEG 图像
大小:119.1K
----------------------------------------------
-
作者:
男 keymark (嬲) ▲▲▲△△ -
普通会员
2022/5/9 19:23:27
12楼: 害 纠结这个干啥.....
估计还没 正式呢吧,api会有很多变动的可能。
emb 官方好像没人跟进 webview2 的dll变动?怕是要等大版本变一次。
----------------------------------------------
[alias]  co = clone --recurse-submodules  up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
作者:
男 roadrunner (roadrunner) ★☆☆☆☆ -
盒子活跃会员
2022/5/10 20:36:59
13楼: 我的DRT库集成了一些有用的功能,欢迎试用一下
https://gitee.com/YWtheGod/DRT

其中包括有免WebView2Loader.DLL使用EdgeBrowser的DEMO
----------------------------------------------
-
作者:
男 zhouying (zy) ★☆☆☆☆ -
盒子活跃会员
2022/5/18 20:43:19
14楼: 后面微软停止IE11了,但是系统内核应该还是会有内置的吧
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行82.03125毫秒 RSS