Example #1
0
        public static async Task ScriptableObjectTestAsync(CefFrame frame)
        {
            dynamic scriptableObject1 = await frame.GetScriptableObjectAsync(CancellationToken.None)
                                        .ConfigureAwait(true);

            dynamic scriptableObject2 = await frame.GetScriptableObjectAsync(CancellationToken.None)
                                        .ConfigureAwait(false);

            dynamic window   = scriptableObject1.window;
            dynamic document = window.document;

            document.title = "document title";

            window.alert(string.Format("Equals: {0}", scriptableObject1 == scriptableObject2 && document == window.document));

            window.alert(document.querySelectorAll("div")[0]);

            MessageBox.Show("window.hello = " + Convert.ToString(window.hello));
        }