Пример #1
0
        public static string ToAcceptList(this EChromeLanguage lang)
        {
            List <EChromeLanguage> echromeLanguageList = new List <EChromeLanguage>()
            {
                lang
            };

            if (lang != EChromeLanguage.EnUsa)
            {
                echromeLanguageList.Add(EChromeLanguage.EnUsa);
            }
            return(EChromeLanguageHelper.GetAcceptList((IEnumerable <EChromeLanguage>)echromeLanguageList));
        }
Пример #2
0
        public FakeProfile Generate()
        {
            FakeProfile rezult = new FakeProfile()
            {
                BrowserTypeType = this.GetAllEnumValues <EBrowserType>(typeof(EBrowserType)).GetRandValue <EBrowserType>(),
                WindowsVersion  = this.GetAllEnumValues <EWindowsVersion>(typeof(EWindowsVersion)).GetRandValue <EWindowsVersion>(),
                IsX64           = RandomNumber.Between(0, 1) == 0
            };

            rezult.UserAgent                    = FakeProfileFactory.GenerateUserAgent(rezult.WindowsVersion, rezult.IsX64);
            rezult.CpuConcurrency               = FakeProfileFactory.CpuConcurrency.GetRandValue <int>();
            rezult.MemoryAvailable              = rezult.CpuConcurrency != 12 ? FakeProfileFactory.MemoryAvailable.Where <int>((Func <int, bool>)(x => x >= rezult.CpuConcurrency)).ToList <int>().GetRandValue <int>() : 8;
            rezult.CanvasFingerPrintHash        = this.GetMd5Hash(rezult.UserAgent + DateTime.Now.ToString((IFormatProvider)CultureInfo.InvariantCulture));
            rezult.BaseLatency                  = this.GenerateBaseLatencyValue();
            rezult.ChannelDataDelta             = this.GenerateRandomInt();
            rezult.ChannelDataIndexDelta        = this.GenerateRandomInt();
            rezult.FloatFrequencyDataDelta      = this.GenerateRandomInt();
            rezult.FloatFrequencyDataIndexDelta = this.GenerateRandomInt();
            rezult.ChromeLanguageInfo           = EChromeLanguageHelper.GetFullInfo(EChromeLanguage.Ru);
            rezult.ScreenSize                   = FakeProfileFactory.ScreenSizes.GetRandValue <ScreenSize>();
            rezult.Fonts = this.GenerateAvailableFonts(rezult.WindowsVersion);
            return(rezult);
        }