From 426e4b3e2cf3b586bbe6ddfe216c05fd35a9df10 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 19 Aug 2025 12:45:51 +0200 Subject: [PATCH 1/5] [WebDriver BiDi] emulate `user-agent` string # Conflicts: # source --- source | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/source b/source index bf6b1fb9326..027da0afc7c 100644 --- a/source +++ b/source @@ -4645,6 +4645,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • navigation status complete
  • navigation status url
  • navigation status suggested filename
  • +
  • WebDriver BiDi emulated User-Agent
  • WebDriver BiDi navigation aborted
  • WebDriver BiDi navigation committed
  • WebDriver BiDi navigation failed
  • @@ -121071,12 +121072,12 @@ interface Navigator { data-x="dom-navigator-appVersion">appVersion getter steps are:

      -
    1. If the default `User-Agent` - value does not start with `Mozilla/5.0 (`, then return the empty - string.

    2. +
    3. Let userAgent be userAgent.
    4. + +
    5. If the userAgent does not start with `Mozilla/5.0 (`, + then return the empty string.

    6. -
    7. Let trail be the substring of the default `User-Agent` value,

      Let trail be the substring of the userAgent, isomorphic decoded, that follows the "Mozilla/" prefix.

    8. @@ -121126,8 +121127,18 @@ interface Navigator {

      The userAgent - getter steps are to return the default `User-Agent` - value.

      + getter steps are:

      + +
        +
      1. Let emulatedUserAgent be the result of WebDriver BiDi emulated + User-Agent with this's relevant settings object.

      2. + +
      3. If emulatedUserAgent is not null, then return + emulatedUserAgent.

      4. + +
      5. Return default `User-Agent` + value.

      6. +

      The vendor getter steps are to return the appropriate string from the following list:

      From 0e0ab1f690b039670aac5b08543b1cf985dab3e4 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 16 Sep 2025 15:13:11 +0200 Subject: [PATCH 2/5] environment-default-user-agent-value --- source | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/source b/source index 027da0afc7c..15f57c29f9b 100644 --- a/source +++ b/source @@ -2603,7 +2603,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    9. A local scheme
    10. A fetch scheme
    11. CORS protocol
    12. -
    13. default `User-Agent` value
    14. +
    15. environment default `User-Agent` value
    16. extract a MIME type
    17. legacy extract an encoding
    18. fetch
    19. @@ -4645,7 +4645,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    20. navigation status complete
    21. navigation status url
    22. navigation status suggested filename
    23. -
    24. WebDriver BiDi emulated User-Agent
    25. WebDriver BiDi navigation aborted
    26. WebDriver BiDi navigation committed
    27. WebDriver BiDi navigation failed
    28. @@ -121072,12 +121071,12 @@ interface Navigator { data-x="dom-navigator-appVersion">appVersion getter steps are:

        -
      1. Let userAgent be userAgent.
      2. - -
      3. If the userAgent does not start with `Mozilla/5.0 (`, - then return the empty string.

      4. +
      5. If the default `User-Agent` + value does not start with `Mozilla/5.0 (`, then return the empty + string.

      6. -
      7. Let trail be the substring of the userAgent,

        Let trail be the substring of the default `User-Agent` value, isomorphic decoded, that follows the "Mozilla/" prefix.

      8. @@ -121127,18 +121126,8 @@ interface Navigator {

        The userAgent - getter steps are:

        - -
          -
        1. Let emulatedUserAgent be the result of WebDriver BiDi emulated - User-Agent with this's relevant settings object.

        2. - -
        3. If emulatedUserAgent is not null, then return - emulatedUserAgent.

        4. - -
        5. Return default `User-Agent` - value.

        6. -
        + getter steps are to return this's relevant settings object's environment default `User-Agent` value.

        The vendor getter steps are to return the appropriate string from the following list:

        From cce8b40ed1048110a743585d584bec9eccbabd99 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 16 Sep 2025 15:30:51 +0200 Subject: [PATCH 3/5] default-user-agent-value --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index 15f57c29f9b..7313c4ec1f9 100644 --- a/source +++ b/source @@ -2603,7 +2603,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      9. A local scheme
      10. A fetch scheme
      11. CORS protocol
      12. -
      13. environment default `User-Agent` value
      14. +
      15. default `User-Agent` value
      16. extract a MIME type
      17. legacy extract an encoding
      18. fetch
      19. @@ -121071,9 +121071,9 @@ interface Navigator { data-x="dom-navigator-appVersion">appVersion getter steps are:

          -
        1. If the default `User-Agent` - value does not start with `Mozilla/5.0 (`, then return the empty - string.

        2. +
        3. If the this's relevant settings object's default `User-Agent` value does not start + with `Mozilla/5.0 (`, then return the empty string.

        4. Let trail be the substring of the default `User-Agent` value, Navigator {

          The userAgent getter steps are to return this's relevant settings object's environment default `User-Agent` value.

          + data-x="default-user-agent-value">default `User-Agent` value.

          The vendor getter steps are to return the appropriate string from the following list:

          From 61f651fa53e30fe272c6bac648627dcb5d851eb6 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 16 Sep 2025 15:50:48 +0200 Subject: [PATCH 4/5] environment-default-user-agent-value --- source | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source b/source index 7313c4ec1f9..2eff9f28c82 100644 --- a/source +++ b/source @@ -2603,7 +2603,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
        5. A local scheme
        6. A fetch scheme
        7. CORS protocol
        8. -
        9. default `User-Agent` value
        10. +
        11. environment default `User-Agent` value
        12. extract a MIME type
        13. legacy extract an encoding
        14. fetch
        15. @@ -121071,13 +121071,14 @@ interface Navigator { data-x="dom-navigator-appVersion">appVersion getter steps are:

            -
          1. If the this's relevant settings object's default `User-Agent` value does not start - with `Mozilla/5.0 (`, then return the empty string.

          2. +
          3. If this's relevant settings object's environment default `User-Agent` value + does not start with `Mozilla/5.0 (`, then return the empty string.

          4. -
          5. Let trail be the substring of the default `User-Agent` value, isomorphic decoded, that follows the "

            Let trail be the substring of this's + relevant settings object's environment default `User-Agent` value, + isomorphic decoded, that follows the "Mozilla/" prefix.

          6. @@ -121127,7 +121128,7 @@ interface Navigator {

            The userAgent getter steps are to return this's relevant settings object's default `User-Agent` value.

            + data-x="environment-default-user-agent-value">environment default `User-Agent` value.

            The vendor getter steps are to return the appropriate string from the following list:

            From 454950bad40044ff0ace00c7cda764f1ae10f093 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Wed, 17 Sep 2025 09:46:22 +0200 Subject: [PATCH 5/5] userAgent in appVersion --- source | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source b/source index 2eff9f28c82..49e33c947eb 100644 --- a/source +++ b/source @@ -121071,14 +121071,15 @@ interface Navigator { data-x="dom-navigator-appVersion">appVersion
            getter steps are:

              -
            1. If this's relevant settings object's environment default `User-Agent` value - does not start with `Mozilla/5.0 (`, then return the empty string.

            2. - -
            3. Let trail be the substring of this's - relevant settings object's environment default `User-Agent` value, - isomorphic decoded, that follows the "

              Let userAgent be this's relevant settings object's + environment default `User-Agent` + value.

            4. + +
            5. If userAgent does not start with `Mozilla/5.0 (`, then + return the empty string.

            6. + +
            7. Let trail be the substring of userAgent, isomorphic decoded, that follows the "Mozilla/" prefix.