예제 #1
0
        async void OnLoadEnd()
        {
            //Check if the browser can execute JavaScript and the ScriptTextBox is filled
            if (chromeBrowser.CanExecuteJavascriptInMainFrame)
            {
                //Evaluate javascript and remember the evaluation result
                JavascriptResponse response = await chromeBrowser.EvaluateScriptAsync(" document.getElementById('back_ground').width; ");

                JavascriptResponse response2 = await chromeBrowser.EvaluateScriptAsync(" document.getElementById('back_ground').height; ");

                if (response.Result != null && response2.Result != null)
                {
                    width  = (int)response.Result;
                    height = (int)response2.Result;
                    this.Invoke(new MethodInvoker(delegate {
                        SetBrowserSize();
                        LauncherScript.LoadScript();
                        if (LauncherScript.mScript != "")
                        {
                            chromeBrowser.ExecuteScriptAsync(LauncherScript.mScript);
                        }
                        patcher = new PATCHER();
                        patcher.Init();
                    }));
                    //MessageBox.Show( "width:"+response.Result.ToString() + ",height:" + response2.Result.ToString(), "JavaScript Result");
                }
            }
        }
예제 #2
0
 public void displayok(int tFullScreenMode, string tResoultion_Value)
 {
     LauncherScript.SetDisplay(tFullScreenMode, tResoultion_Value);
 }
예제 #3
0
 async public void display(string message)
 {
     LauncherScript.setDisplayOptionJS();
     JavascriptResponse response2 = await Form1.chromeBrowser.EvaluateScriptAsync(" showDisplaySetting('" + message + "'); ");
 }