首页 > 其他分享 >CEF4Delphi(DELPHI Google Chrome 浏览器封装) 折腾 (2)--打开一个网页

CEF4Delphi(DELPHI Google Chrome 浏览器封装) 折腾 (2)--打开一个网页

时间:2023-08-25 16:44:06浏览次数:27  
标签:begin Google end Chrome DELPHI TForm1 Application 网页

   打开网页的,折腾了好久,试运行DEMO,就行,把DELPHI的代码抄过来,就是不行,然后把自己弄的 控件名称搞的与DEMO一样,属性全对一样了,还是不行,郁闷很久后,才发现工程文件里面还要加代码。

 

我的工程名为:OpenChrome

 

选中工程文件后按CTRL+V,然后做以下修改:下面红色的代码是CEF4中需要增加的。

 

program OpenChrome;

uses
  Vcl.Forms,
  uCEFApplication,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
 GlobalCEFApp := TCefApplication.Create;
  if GlobalCEFApp.StartMainProcess then
    begin
    Application.Initialize;
    Application.MainFormOnTaskbar := True;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
    end;
end.

在界面上丢个 ChromiumWindow 控件,名称为:ChromiumWindow1

然后两个代码,就完成加载一个网页了

 

procedure TForm1.Button1Click(Sender: TObject);
begin
  ChromiumWindow1.LoadURL('https://www.cnblogs.com/zhqian/');
end;

procedure TForm1.FormShow(Sender: TObject);
begin
ChromiumWindow1.CreateBrowser;
end;

 

标签:begin,Google,end,Chrome,DELPHI,TForm1,Application,网页
From: https://www.cnblogs.com/zhqian/p/17657351.html

相关文章

  • CEF4Delphi(DELPHI Google Chrome 浏览器封装) 折腾 (1)--安装
    1、下载:https://github.com/salvadordf/CEF4Delphi/tree/master2、安装包:CEF4Delphi-master\packages目录中,如果不行,全部包都编译一下。3、下载运行环境:地址到 https://github.com/salvadordf/CEF4Delphi/tree/master中能查的到 Windows32bitsWindows64bitsLinux......
  • Ubuntu22安装Chrome浏览器
    翻译自博客1.将下载的chrome安装包放在~/Downloads文件夹下$cd~/Downloads#wget是一个下载工具$wgethttps://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb2.安装chrome#dpkg是一个安装软件软件的工具sudodpkg-igoogle-chrome-stable_curre......
  • chrome 升级到最新版本
     1.chrome升级到一个很新的版本:116,突然报了一个奇怪的错误: selenium:Thereisnosuchdriverbyurlhttps://chromedriver.storage.googleapis.com/Currentbrowserversionis116.0.5845.110我发现不回退chrome版本,升级pip3install--upgradewebdriver-manag......
  • Google Chrome和ChromeDriver版本号不一致问题解决
    1(base)kaka@KakadeMBPbin%/Applications/Google\Chrome.app/Contents/MacOS/Google\Chrome--version2GoogleChrome116.0.5845.963(base)kaka@KakadeMBPbin%chromedriver--version4ChromeDriver114.0.5735.16(7e1ff058633f5b79b1cd7479aca585ba385......
  • Chrome116驱动下载路径 解决版本不匹配问题
    更新于2023-08-23后续可能会有同步,就不会引发该问题要看解决可以直接看最后的总结背景执行selenium代码报错fromseleniumimportwebdriverdriver=webdriver.Chrome()原因selenium.common.exceptions.SessionNotCreatedException:Message:sessionnotcreated:......
  • 6款程序员必备的 Chrome 扩展插件!逼格秒提升
    美化JustBlack午夜黑主题简介:Chrome官方团队出品的黑色主题皮肤,值得拥有!推荐指数:⭐⭐⭐⭐⭐下载链接:https://www.chajianxw.com/themes/18893.htmlDarkReader暗黑主题简介:能在任何网站上开启夜间模式,同时,它还支持自定义调整亮度、对比度,应用棕褐色滤镜、黑暗模式,设置字体和忽......
  • 11 款程序员必备的 Chrome 扩展插件! 提升开发效率!
    Octotree树形菜单简介:Octotree是一款增强GitHub代码审查和探索的浏览器扩展,可以非常方便帮助您查阅代码。推荐指数:⭐⭐⭐⭐⭐下载链接:https://www.chajianxw.com/developer/11032.html划词翻译简介:一站式划词/截图/网页全文/音视频翻译扩展,支持谷歌、DeepL、百度、搜狗等......
  • Google classic interview questions, throwing eggs the least number of times All
    Googleclassicinterviewquestions,throwingeggstheleastnumberoftimesAllInOne谷歌经典面试题,扔鸡蛋最少次数14✅你在一栋100层的大楼里工作,你得到2个相同的鸡蛋。你需要计算出鸡蛋可以掉落到最高的楼层而不破裂。问题是你需要投掷多少次。找到一种在......
  • Delphi XE UniGUI ExtJS [7] Delhi 动态添加 ClientEvents.ExtEvents 事件
    UniButton1.ClientEvents.ExtEvents.Values['click']:='function(sender){alert("Click")}';UniEdit1.ClientEvents.ExtEvents.Values['change']:='function(sender,newValue){UniForms.UniEdit2.setValue(newValue)}';Un......
  • DELPHI 文件自动备份工具源码分享
    一.工具界面如下(没做UI) 二.设计视图如下: 三.控件说明:1.使用到了第三方StyleControl控件中的SCGPLabel,SCGPEdit,SCGPCheckBox,SCGPCombobox,SCGPButton,这几个控件如果需要,可替换成秕自带控件.难度-12.TrayIcon这个是让程序缩小到托盘上面去的.3.Pop......