zoukankan      html  css  js  c++  java
  • delphi webbrowser 跨域访问

    procedure IterateFrames(const AWB: IWebBrowser2);
    var
    Doc: IHTMLDocument2;
    Container: IOleContainer;
    Enumerator: ActiveX.IEnumUnknown;
    Unknown: IUnknown;
    Browser: IWebBrowser2;
    Fetched: Longint;
    NewDoc: IHTMLDocument2;
    begin
    if (Assigned(AWB.Document)) and (Supports(AWB.Document, IHTMLDocument2, Doc)) then
    begin
    // Recursive searching.
    // ACHTUNG! We cannot use the document's frames collection here, because
    // it does not work in every case (i.e. Documents from a foreign domain).
    // From: support.microsoft.com/support/kb/articles/Q196/3/40.ASP
    if (Supports(Doc, IOleContainer, Container)) and (Container.EnumObjects(OLECONTF_EMBEDDINGS, Enumerator) = S_OK) then
    begin
    while Enumerator.Next(1, Unknown, @Fetched) = S_OK do
    if (Supports(Unknown, IWebBrowser2, Browser)) and (Supports(Browser.Document, IHTMLDocument2, NewDoc)) then
    begin
    //DoSomethingWithNewDoc;
    IterateFrames(AWB);
    end;
    end;
    end;
    end;

  • 相关阅读:
    5-5图层的链接-新版本不常用
    5-4图层的不透明度
    5-3图层的层次关系
    5-2图层的选择
    5-1图层初识
    RTP协议文章收藏
    NW.js桌面应用开发(一)
    WebRTC笔记(一)
    mediasoup-demo解析-客户端
    npx工具
  • 原文地址:https://www.cnblogs.com/honeynm/p/4653651.html
Copyright © 2011-2022 走看看