Skip to content

Conversation

Copy link
Contributor

Copilot AI commented May 23, 2025

This PR adds the #nullable enable directive to 5 supplement interface files in the Microsoft.Playwright namespace:

  • src/Playwright/API/Supplements/IBrowser.cs
  • src/Playwright/API/Supplements/ICDPSession.cs
  • src/Playwright/API/Supplements/IJSHandle.cs
  • src/Playwright/API/Supplements/IAPIRequestContext.cs
  • src/Playwright/API/Supplements/ILocator.cs

These changes start the process of enabling nullable reference types throughout the codebase, which will help prevent null reference exceptions like the one described in issue #3161.

For interfaces with method parameters, null annotations have been added to parameters that previously allowed null (changing object arg = null to object? arg = null).

According to the plan, we'll continue adding #nullable enable directives to more files in future PRs, 5 files at a time. Once all files have been updated, we'll be able to enable nullable globally in the csproj file and remove the individual directives.

Fixes #3163.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl3.digicert.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)
  • crl4.digicert.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)
  • ocsp.digicert.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)
  • playwright.azureedge.net
    • Triggering command: /home/REDACTED/work/playwright-dotnet/playwright-dotnet/src/tools/Playwright.Tooling/bin/Debug/net8.0/Playwright.Tooling download-drivers --basepath . (dns block)
  • s.symcb.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)
  • s.symcd.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)
  • ts-crl.ws.symantec.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)
  • ts-ocsp.ws.symantec.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet build src/tools/Playwright.Tooling/Playwright.Tooling.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: mxschmitt <17984549+mxschmitt@users.noreply.github.com>
Copilot AI changed the title [WIP] [internal] Enable <Nullable>enable</Nullable> in src/Playwright/Playwright.csproj [internal] Add #nullable enable directives to 5 supplement files May 23, 2025
Copilot AI requested a review from mxschmitt May 23, 2025 15:52
@mxschmitt
Copy link
Contributor

do not do #nullable disable at the end of the file.

Co-authored-by: mxschmitt <17984549+mxschmitt@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 23, 2025

do not do #nullable disable at the end of the file.

I've removed all #nullable disable directives at the end of the 5 files as requested in commit a70451f.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl3.digicert.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)
  • crl4.digicert.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)
  • ocsp.digicert.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)
  • playwright.azureedge.net
    • Triggering command: /home/REDACTED/work/playwright-dotnet/playwright-dotnet/src/tools/Playwright.Tooling/bin/Debug/net8.0/Playwright.Tooling download-drivers --basepath . (dns block)
  • s.symcb.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)
  • s.symcd.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)
  • ts-crl.ws.symantec.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)
  • ts-ocsp.ws.symantec.com
    • Triggering command: dotnet build src/Playwright/Playwright.csproj (dns block)
    • Triggering command: dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath . (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@mxschmitt mxschmitt marked this pull request as ready for review May 23, 2025 16:21
@mxschmitt mxschmitt closed this May 24, 2025
@mxschmitt mxschmitt deleted the copilot/fix-3163 branch May 28, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[internal] Enable <Nullable>enable</Nullable> in src/Playwright/Playwright.csproj

3 participants