Skip to content

[🐛 Bug]: Unable to allow third-party cookies in Chrome Incognito mode since version 139 #16238

@sergigr527

Description

@sergigr527

Description

Hello all,

Since Chrome was updated to version 139, I have not been able to allow third-party cookies in Incognito mode.

Image

I have tried several approaches to enable third-party cookies, but all of them have failed. Everything was working correctly up to and including version 138. Starting with version 139, none of the previous configurations work, and when I click on the lock icon next to the URL bar, the cookies setting shows as blocked.

At this point, I’m not sure whether this is a Selenium issue or a new Chrome feature/change.

Reproducible Code

public void InitDriver(ref IWebDriver driver, bool isMobile = false)
{
    var options = new ChromeOptions();

    // --- Browser mode ---
    options.AddArgument("--incognito");
    options.AddArgument("--start-maximized");
    options.AddArgument("--no-sandbox");
    options.AddArgument("--disable-dev-shm-usage");

    // --- Feature flags ---
    options.AddArgument("--disable-features=BlockInsecurePrivateNetworkRequests,ThirdPartyCookiesBlocking");
    options.AddArguments("--disable-search-engine-choice-screen");

    // --- Cookie & content preferences ---
    options.AddUserProfilePreference("profile.default_content_setting_values.cookies", 1);  // Allow cookies
    options.AddUserProfilePreference("profile.block_third_party_cookies", false);          // Allow 3rd party cookies
    options.AddUserProfilePreference("profile.cookie_controls_mode", 0);                   // Disable cookie controls

    // --- Download preferences ---
    options.AddUserProfilePreference("download.prompt_for_download", false);

    // --- Logging ---
    options.SetLoggingPreference(LogType.Browser, LogLevel.All);

    // --- Driver setup ---
    string version = new DriverManager().SetUpDriver(
        new ChromeConfig(),
        VersionResolveStrategy.MatchingBrowser
    );

    string driverPath = version.Substring(0, version.LastIndexOf(@"\"));
    driver = new ChromeDriver(driverPath, options);
}

ℹ️ Last known working version: 4.35

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-dotnet.NET BindingsD-chromeG-chromedriverRequires fixes in ChromeDriverI-defectSomething is not working as intendedI-regressionSomething was working but we "fixed" itOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions