Beispiel #1
0
        public string JSCall(string script)
        {
            string outString = "";

            using (var js = new Gecko.AutoJSContext(browser.Window.JSContext))
            {
                try
                {
                    js.EvaluateScript(script, (Gecko.nsISupports)browser.Window.DomWindow, out outString);
                }
                catch (Gecko.GeckoJavaScriptException ex)
                {
                    System.Console.WriteLine(ex.Message);
                }
                catch (System.NotImplementedException ex)
                {
                    System.Console.WriteLine(ex.Message);
                }
            }
            return(outString);
        }
        private void LoadChatBoxWebControl()
        {
            isChatBoxLoaded = false;

            chatBoxWebControl.Navigate(Chat.Constants.ChatBoxHtmlPath);

            geckoJs = new Gecko.AutoJSContext(chatBoxWebControl.Window);

            Gecko.GeckoPreferences.User["dom.max_script_run_time"]    = 0;
            Gecko.GeckoPreferences.Default["dom.max_script_run_time"] = 0;

            chatBoxWebControl.Document.Body.Style.CssText = "overflow:hidden";

            if (isWindowShown)
            {
                ShowScrollbars();
            }
            else
            {
                HideScrollbars();
            }

            isChatBoxLoaded = true;
        }