Example #1
0
        public static IHTMLDocument GetFrameDocument(IHTMLFrameBase2 frameElement)
        {
            if (frameElement != null)
            {
                return GetFrameDocument(frameElement.contentWindow);
            }

            return null;
        }
Example #2
0
        public static IHTMLDocument GetFrameDocument(IHTMLFrameBase2 frameElement)
        {
            if (frameElement != null)
            {
                return(GetFrameDocument(frameElement.contentWindow));
            }

            return(null);
        }
Example #3
0
        private void AttachWindow(IHTMLWindow2 win)
        {
            if (false == this.IsRecording)
            {
                return;
            }

            if (true == this.IsRemarked(win))
            {
                return;
            }

            Debug.Print("Recorder.AttachWindow = {0}", win.location.href);

            this.SetRemark(win);

#if DEBUG
            Stopwatch sw = new Stopwatch();
            sw.Start();
#endif

            IHTMLDocument2 doc = win.document;

            this.AttachInputElements(doc);
            this.AttachAnchorElements(doc);
            this.AttachTextAreaElements(doc);
            this.AttachSelectElements(doc);
            this.AttachLabelElements(doc);
            this.AttachButtonElements(doc);

            if (null == win.frames)
            {
                return;
            }

            for (int i = 0; i < win.frames.length; i++)
            {
                IHTMLFrameBase2 frame = win.frames.item(i) as IHTMLFrameBase2;

                if (null == frame)
                {
                    continue;
                }

                this.AttachWindow(frame.contentWindow);
            }

#if DEBUG
            sw.Stop();
            Debug.Print("{0}", sw.Elapsed);
#endif
        }
Example #4
0
        public void InitializeSubDocument(IHTMLDocument document)
        {
            IHTMLDocument3 buffer = document as IHTMLDocument3;

            foreach (IHTMLElement item in buffer.getElementsByTagName("IFRAME"))
            {
                try
                {
                    IHTMLFrameBase2 ele    = item as IHTMLFrameBase2;
                    IHTMLDocument   subDoc = ele.contentWindow.document;
                    subFrame.Add(subDoc);
                    InitializeSubDocument(ele.contentWindow.document);
                }
                catch (UnauthorizedAccessException)
                {
                    //권한 에러는 무시
                }
            }
        }