Delphi EmbeddedWB 遍历Frames并执行子frame的js脚本


本文整理自网络,侵删。

 var
  wDoc:IHTMLDocument2;

  wc:IHTMLWindow2;
  Dispatch:IDispatch;
begin
   //遍历emWb:TEmbeddedWB的Frames
   if emWb <> nil then
   begin

     wDoc := ((emWb.Document as IHTMLDocument2));
     if Assigned(wDoc) then
     begin
           for i=0 to wDoc.frams.length -1 do //遍历

           begin

                Dispatch:= wd.frames.item(0);
                Dispatch.QueryInterface(IHTMLWindow2,wc); //获得子frame的IHTMLWindow2对象

                wc.execScript('logout()','JavaScript');//执行js
          end;                    
      end;
   end;
 end;

相关阅读 >>

Delphi气泡提示

Delphi android检查互联网连接

Delphi执行js

Delphi fmx输出彩色文本

Delphi 10.3 控件遮挡 webbrowser

Delphi tlist性能注意事项

Delphi 遍历所有目录和子目录下的文件名(可按后缀名遍历)

Delphi 在桌面中嵌入窗体

Delphi webbrowser有关技术

Delphi sqlite防止插入重复数据的方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...