FIXUP: URLs are not fixed when bookmarks are created or updated using the bookmark extension API [chromium/src : main]

0 views
Skip to first unread message

YISI YU (Gerrit)

unread,
Jan 8, 2026, 5:21:41 AM (yesterday) Jan 8
to James Cook, Tom Lukaszewicz, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from James Cook and Tom Lukaszewicz

YISI YU voted and added 1 comment

Votes added by YISI YU

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
YISI YU . resolved

Hello James. Hello Tom. The change is ready, PTAL, thanks!

The root cause of [this issue](https://issues.chromium.org/issues/402056130) is that `url_formatter::FixupURL()` is not called to fix the URL when navigating to an `about://` URL from bookmark, which triggers a DCHECK assertion failure [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/browser_about_handler.cc;l=51). (The OmniBox does not have this issue because it uses `url_formatter::FixupURL()` to correct the URL [here](https://source.chromium.org/chromium/chromium/src/+/main:components/omnibox/browser/autocomplete_input.cc;l=273).)

There are two ways to resolving this issue: the first is to call `url_formatter::FixupURL()` when a bookmark navigates [before this line](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc;l=161?q=chrome%2Fbrowser%2Fui%2Fbookmarks%2Fbookmark_utils_desktop.cc&ss=chromium%2Fchromium%2Fsrc), and the second is to call `url_formatter::FixupURL()` when creating or updating URLs via the bookmarks extension API.

I chose to fix the issue by adjusting the bookmarks extension API. This is because `FixupURL()` is called when creating or updating bookmarks in the bookmark bar [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc;l=446;bpv=1;bpt=0?q=bookmark_editor_view.&ss=chromium%2Fchromium%2Fsrc), whereas the bookmarks extension API does not perform such correction. Aligning behavior with the bookmark bar is likely the best option (and can prevent potential issues caused by unexpected input).

Open in Gerrit

Related details

Attention is currently required from:
  • James Cook
  • Tom Lukaszewicz
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
Gerrit-Change-Number: 7414639
Gerrit-PatchSet: 3
Gerrit-Owner: YISI YU <hello...@gmail.com>
Gerrit-Reviewer: James Cook <jame...@chromium.org>
Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
Gerrit-Reviewer: YISI YU <hello...@gmail.com>
Gerrit-Attention: James Cook <jame...@chromium.org>
Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
Gerrit-Comment-Date: Thu, 08 Jan 2026 10:21:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Tom Lukaszewicz (Gerrit)

unread,
Jan 8, 2026, 12:26:26 PM (22 hours ago) Jan 8
to YISI YU, James Cook, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from James Cook and YISI YU

Tom Lukaszewicz voted and added 1 comment

Votes added by Tom Lukaszewicz

Code-Review+1
Commit-Queue+2

1 comment

Patchset-level comments
Tom Lukaszewicz . resolved

lgtm

Open in Gerrit

Related details

Attention is currently required from:
  • James Cook
  • YISI YU
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
Gerrit-Change-Number: 7414639
Gerrit-PatchSet: 3
Gerrit-Owner: YISI YU <hello...@gmail.com>
Gerrit-Reviewer: James Cook <jame...@chromium.org>
Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
Gerrit-Reviewer: YISI YU <hello...@gmail.com>
Gerrit-Attention: James Cook <jame...@chromium.org>
Gerrit-Attention: YISI YU <hello...@gmail.com>
Gerrit-Comment-Date: Thu, 08 Jan 2026 17:25:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

James Cook (Gerrit)

unread,
Jan 8, 2026, 1:34:27 PM (21 hours ago) Jan 8
to YISI YU, Tom Lukaszewicz, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Tom Lukaszewicz and YISI YU

James Cook voted and added 4 comments

Votes added by James Cook

Code-Review+1

4 comments

Patchset-level comments
James Cook . resolved

LGTM with nits

File chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
Line 67, Patchset 3 (Latest): return url_formatter::FixupURL(url_string, std::string());
James Cook . unresolved

nit: I would leave off the std::string() part, since there's a default for that argument.

optional: Consider just inlining calls to url_formatter::FixupURL() instead of adding this helper function.

File chrome/browser/extensions/api/bookmarks/bookmarks_api_unittest.cc
Line 111, Patchset 3 (Latest): extensions::api::bookmarks::BookmarkTreeNode::FromValue(create_result)
James Cook . unresolved

nit: "extensions::" not needed

Line 125, Patchset 3 (Latest): extensions::api::bookmarks::BookmarkTreeNode::FromValue(update_result)
James Cook . unresolved

ditto

Open in Gerrit

Related details

Attention is currently required from:
  • Tom Lukaszewicz
  • YISI YU
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
    Gerrit-Change-Number: 7414639
    Gerrit-PatchSet: 3
    Gerrit-Owner: YISI YU <hello...@gmail.com>
    Gerrit-Reviewer: James Cook <jame...@chromium.org>
    Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
    Gerrit-Reviewer: YISI YU <hello...@gmail.com>
    Gerrit-Attention: YISI YU <hello...@gmail.com>
    Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 18:34:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    YISI YU (Gerrit)

    unread,
    Jan 8, 2026, 2:16:55 PM (20 hours ago) Jan 8
    to James Cook, Tom Lukaszewicz, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from James Cook and Tom Lukaszewicz

    YISI YU voted and added 4 comments

    Votes added by YISI YU

    Auto-Submit+1
    Commit-Queue+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 4 (Latest):
    YISI YU . resolved

    The change is ready, PTAL, thanks!

    File chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
    Line 67, Patchset 3: return url_formatter::FixupURL(url_string, std::string());
    James Cook . resolved

    nit: I would leave off the std::string() part, since there's a default for that argument.

    optional: Consider just inlining calls to url_formatter::FixupURL() instead of adding this helper function.

    YISI YU

    Aha, it looks like this default parameter was just added yesterday. Done.

    I made this helper function a separate one because I wrote a big comment explaining why we need to do it (and it has 2 references in this file). This probably makes the code a bit easier to read.

    File chrome/browser/extensions/api/bookmarks/bookmarks_api_unittest.cc
    Line 111, Patchset 3: extensions::api::bookmarks::BookmarkTreeNode::FromValue(create_result)
    James Cook . resolved

    nit: "extensions::" not needed

    YISI YU

    Done. I have removed all redundant `extension::`

    Line 125, Patchset 3: extensions::api::bookmarks::BookmarkTreeNode::FromValue(update_result)
    James Cook . resolved

    ditto

    YISI YU

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • James Cook
    • Tom Lukaszewicz
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
      Gerrit-Change-Number: 7414639
      Gerrit-PatchSet: 4
      Gerrit-Owner: YISI YU <hello...@gmail.com>
      Gerrit-Reviewer: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
      Gerrit-Reviewer: YISI YU <hello...@gmail.com>
      Gerrit-Attention: James Cook <jame...@chromium.org>
      Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
      Gerrit-Comment-Date: Thu, 08 Jan 2026 19:16:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: James Cook <jame...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      James Cook (Gerrit)

      unread,
      Jan 8, 2026, 2:28:42 PM (20 hours ago) Jan 8
      to YISI YU, Tom Lukaszewicz, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from Tom Lukaszewicz and YISI YU

      James Cook voted and added 1 comment

      Votes added by James Cook

      Code-Review+1

      1 comment

      Patchset-level comments
      James Cook . resolved

      LGTM. Tom, I think you'll need to re-stamp this, it lost your +1.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Tom Lukaszewicz
      • YISI YU
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
      Gerrit-Change-Number: 7414639
      Gerrit-PatchSet: 4
      Gerrit-Owner: YISI YU <hello...@gmail.com>
      Gerrit-Reviewer: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
      Gerrit-Reviewer: YISI YU <hello...@gmail.com>
      Gerrit-Attention: YISI YU <hello...@gmail.com>
      Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
      Gerrit-Comment-Date: Thu, 08 Jan 2026 19:28:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tom Lukaszewicz (Gerrit)

      unread,
      Jan 8, 2026, 3:16:15 PM (19 hours ago) Jan 8
      to YISI YU, James Cook, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from YISI YU

      Tom Lukaszewicz voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • YISI YU
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
        Gerrit-Change-Number: 7414639
        Gerrit-PatchSet: 4
        Gerrit-Owner: YISI YU <hello...@gmail.com>
        Gerrit-Reviewer: James Cook <jame...@chromium.org>
        Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: YISI YU <hello...@gmail.com>
        Gerrit-Attention: YISI YU <hello...@gmail.com>
        Gerrit-Comment-Date: Thu, 08 Jan 2026 20:15:37 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        James Cook (Gerrit)

        unread,
        Jan 8, 2026, 3:36:08 PM (19 hours ago) Jan 8
        to YISI YU, Tom Lukaszewicz, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
        Attention needed from YISI YU

        James Cook voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • YISI YU
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
        Gerrit-Change-Number: 7414639
        Gerrit-PatchSet: 4
        Gerrit-Owner: YISI YU <hello...@gmail.com>
        Gerrit-Reviewer: James Cook <jame...@chromium.org>
        Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: YISI YU <hello...@gmail.com>
        Gerrit-Attention: YISI YU <hello...@gmail.com>
        Gerrit-Comment-Date: Thu, 08 Jan 2026 20:35:56 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jan 8, 2026, 4:12:54 PM (18 hours ago) Jan 8
        to YISI YU, James Cook, Tom Lukaszewicz, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        FIXUP: URLs are not fixed when bookmarks are created or updated using the bookmark extension API

        `chrome.bookmarks` does not fix URLs during creation or updates. This
        causes inconsistent behavior with the bookmark bar and also leads to
        potential issues. Users can add URLs with the `about://` scheme to
        bookmarks via the extension API, which triggers a `DCHECK` when the
        bookmarks are opened. Use `url_formatter::FixupURL()` to correct the
        URLs, e.g., converting `about://` to `chrome://`
        Fixed: 402056130
        Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
        Commit-Queue: James Cook <jame...@chromium.org>
        Reviewed-by: Tom Lukaszewicz <tl...@chromium.org>
        Auto-Submit: YISI YU <hello...@gmail.com>
        Reviewed-by: James Cook <jame...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1566507}
        Files:
        • M chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
        • M chrome/browser/extensions/api/bookmarks/bookmarks_api_unittest.cc
        Change size: M
        Delta: 2 files changed, 94 insertions(+), 48 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by James Cook, +1 by Tom Lukaszewicz
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
        Gerrit-Change-Number: 7414639
        Gerrit-PatchSet: 5
        Gerrit-Owner: YISI YU <hello...@gmail.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: James Cook <jame...@chromium.org>
        Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: YISI YU <hello...@gmail.com>
        open
        diffy
        satisfied_requirement

        YISI YU (Gerrit)

        unread,
        Jan 8, 2026, 7:08:34 PM (16 hours ago) Jan 8
        to Chromium LUCI CQ, James Cook, Tom Lukaszewicz, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

        YISI YU added 1 comment

        Patchset-level comments
        File-level comment, Patchset 5 (Latest):
        YISI YU . resolved

        Thank you very much!

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iaa34560718f53ce00677f0c5a9d7453df644a3cd
        Gerrit-Change-Number: 7414639
        Gerrit-PatchSet: 5
        Gerrit-Owner: YISI YU <hello...@gmail.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: James Cook <jame...@chromium.org>
        Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: YISI YU <hello...@gmail.com>
        Gerrit-Comment-Date: Fri, 09 Jan 2026 00:08:00 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages