Question

Here's the code:

    static void Main(string[] args)
    {
        Semaphore loadFinished = new Semaphore(0, 1);

        WebCore.Initialize(new WebCoreConfig() { CustomCSS = "::-webkit-scrollbar { visibility: hidden; }" });

        using (WebView webView = WebCore.CreateWebView(1200, 800))
        {
            webView.LoadCompleted += (a, b) => 
            { 
                loadFinished.Release(); 
            };
            webView.LoadURL("http://store.apple.com/ca/browse/home/shop_iphone/family/iphone/iphone4s");

            loadFinished.WaitOne();

            webView.Render().SaveToJPEG(@"D:\Users\menkaur\Documents\stream\2012\apple-store\awesonium\result.jpg", 100);
        }

        // Announce.
        Console.Write("Hit any key to see the result...");
        Console.ReadKey(true);

        // Start the application associated with .png files
        // and display the file.
        Process.Start(@"D:\Users\menkaur\Documents\stream\2012\apple-store\awesonium\result.jpg");

        // Shut down Awesomium before exiting.
        WebCore.Shutdown();

        Console.ReadKey(true);
    }

the website never loads; however, viewed from normal chrome, it looks just fine; also, I've tested the code with google.com, and it works fine as well

What could be wrong?

Was it helpful?

Solution

ok. Here's solution:

            while (!loadFinished.WaitOne(100))
            {
                WebCore.Update();
            }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top