Esempio n. 1
0
        public ConfirmationFormWeb(SteamGuardAccount steamAccount)
        {
            InitializeComponent();
            this.steamAccount = steamAccount;
            this.Text         = String.Format("Trade Confirmations - {0}", steamAccount.AccountName);

            CefSettings settings = new CefSettings();

            settings.PersistSessionCookies = false;
            settings.Locale    = "en-US";
            settings.UserAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 6P Build/XXXXX; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/47.0.2526.68 Mobile Safari/537.36";
            steamCookies       = String.Format("mobileClientVersion=0 (2.1.3); mobileClient=android; steamid={0}; steamLogin={1}; steamLoginSecure={2}; Steam_Language=english; dob=;", steamAccount.Session.SteamID.ToString(), steamAccount.Session.SteamLogin, steamAccount.Session.SteamLoginSecure);

            if (!Cef.IsInitialized)
            {
                Cef.Initialize(settings);
            }

            browser = new ChromiumWebBrowser(steamAccount.GenerateConfirmationURL())
            {
                Dock = DockStyle.Fill,
            };
            this.splitContainer1.Panel2.Controls.Add(browser);

            BrowserRequestHandler handler = new BrowserRequestHandler();

            handler.Cookies              = steamCookies;
            browser.RequestHandler       = handler;
            browser.AddressChanged      += Browser_AddressChanged;
            browser.LoadingStateChanged += Browser_LoadingStateChanged;
        }
        public ConfirmationFormWeb(SteamGuardAccount steamAccount)
        {
            InitializeComponent();
            this.steamAccount = steamAccount;
            this.Text = String.Format("Trade Confirmations - {0}", steamAccount.AccountName);

            CefSettings settings = new CefSettings();
            settings.PersistSessionCookies = false;
            settings.UserAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 6P Build/XXXXX; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/47.0.2526.68 Mobile Safari/537.36";
            steamCookies = String.Format("mobileClientVersion=0 (2.1.3); mobileClient=android; steamid={0}; steamLogin={1}; steamLoginSecure={2}; Steam_Language=english; dob=;", steamAccount.Session.SteamID.ToString(), steamAccount.Session.SteamLogin, steamAccount.Session.SteamLoginSecure);

            if (!Cef.IsInitialized)
            {
                Cef.Initialize(settings);
            }

            browser = new ChromiumWebBrowser(steamAccount.GenerateConfirmationURL())
            {
                Dock = DockStyle.Fill,
            };
            this.splitContainer1.Panel2.Controls.Add(browser);

            BrowserRequestHandler handler = new BrowserRequestHandler();
            handler.Cookies = steamCookies;
            browser.RequestHandler = handler;
            browser.AddressChanged += Browser_AddressChanged;
            browser.LoadingStateChanged += Browser_LoadingStateChanged;
        }