private void HandleApplicationIdle(object sender, EventArgs e)
        {
            GeckoDocument document = (m_browser as GeckoWebBrowser).Document;

            // if body contains something assume navigation complete.
            if (!m_loadEventHandled || document == null || document.DocumentElement == null || document.ChildNodes.Count == 0)
            {
                return;
            }

            Application.Idle -= HandleApplicationIdle;

            if (NavigateFinished != null)
            {
                NavigateFinished(this, new EventArgs());
            }
        }
示例#2
0
        /// <summary>
        /// Appends a script block with the id of CLIENT_SIDE_JAVASCRIPT_ID, adds it to the dom tree
        /// </summary>
        /// <param name="strSourceJavaScript">Javascript code.</param>
        private void ScriptBuilder(string strSourceJavaScript)
        {
            GeckoDocument doc = GeckoDocument.Create((nsIDOMHTMLDocument)oDomWindow.GetDocumentAttribute());
            GeckoElement  ge  = doc.GetElementById(CLIENT_SIDE_JAVASCRIPT_ID);

            if (ge != null)
            {
                doc.Body.RemoveChild(ge);
            }

            ge = doc.CreateElement("script");
            ge.SetAttribute("type", "text/javascript");
            ge.SetAttribute("id", CLIENT_SIDE_JAVASCRIPT_ID);

            StringBuilder textContent = new StringBuilder();

            textContent.Append(strSourceJavaScript);

            ge.TextContent = textContent.ToString();
            doc.Body.AppendChild(ge);
        }
 internal StyleSheetCollection(GeckoDocument document)
 {
     this.List = ((nsIDOMDocumentStyle)document.DomDocument).GetStyleSheets();
 }
示例#4
0
 internal StyleSheetCollection(GeckoDocument document)
 {
     this.List = document.DomDocument.GetStyleSheetsAttribute();
 }