Skip to content

Add an extension: replace Chromium's install dialog with Arc's (or Dia's) dialog, which needs an engine hook #998

Done

Description

@tonibiocic

Which app

Mac

What you'd like

I would like Cra to show its own dialog when a user adds an extension, in place of Chromium's install dialog. The dialog needs a small engine change, because Swift cannot read the prompt's data today. Please tell me which look you want, and whether you accept the engine change. If you do, I can send the Swift side as a pull request once the engine carries the hook.

What happens now

When a user adds an extension (Web Store, a dropped .crx), Cra shows Chromium's own install dialog. Cra frames it over the window, but the dialog itself is Chromium's.

cra-test-build-install-dialog

How Arc did it

Arc 1.176.0 shows its own dialog. It has a dark rounded panel. At the top is the Arc app icon, a left arrow and the extension's icon. The title is Add the "Snake" extension to Arc?. Under it is the line This extension requires no special permissions., or the list of permissions when the extension asks for some. Cancel has an ESC key cap. A blue Add Extension button has a Return key cap.

arc-1 176 0-install-dialog-snake

What Dia shows

Dia, by the same company, shows the same design with changes. The permissions are listed under It can: in a box. The title is Add "Claude" to Dia?. The button is Add to Dia, with a Return key cap.

dia-install-dialog-claude

Two variants

Cra can follow either one. The Arc variant copies Arc 1.176.0. The Dia variant copies Dia. I prefer the Dia variant, because Dia carries Arc's design further after Arc's development stopped. Either is fine for me, and the choice is yours.

Why it needs the engine

Swift gets only the window of Chromium's dialog. Sources/Cra/UI/Windows/ChromiumDialogs.swift hooks Chromium's window class to frame it. Swift never gets the prompt's data. It can read the title, the permission lines and the buttons from accessibility. It cannot read the extension's icon.

Two locked scenarios read Chromium's dialog today: extension-dialogs (#349) and extension-crx-drop (#593).

Proposed engine change

It follows cra-permissions.patch.

  • A hook header, engine/chromium/hooks/cra_extension_install_hook.h, which apply.sh copies into the Chromium tree, as it does for cra_permission_hook.h.
  • A patch on ShowExtensionInstallDialogImpl in chrome/browser/ui/views/extensions/extension_install_dialog_view.cc. When Cra takes the prompt, the patch hands it to the hook. Otherwise Chromium shows its own dialog.
  • A new file, engine/chromium/cra/extension_install_prompt.mm. It gives Swift the extension name, the dialog title, the icon, the permission lines and the prompt type. The prompt type lets re-enable and other prompts stay Chromium's. It also takes an accept or cancel answer from Swift.
  • The hook is set in bridge.mm, beside g_permission_prompt.

I took the function names from public Chromium source. I have not checked them against 159.0.8154.45 yet, so they need that check.

After an engine build

  • The title and the permission lines become CraCore decisions, with tests.
  • The dialog is built in AppKit.
  • A cra://debug readout shows the dialog's state.
  • A new scenario covers the dialog.
  • The two locked scenarios, extension-dialogs and extension-crx-drop, change to read Cra's dialog. This needs your yes.

Cra version

Version 0.1.59 (202611280246 · Chromium 159.0.8154.45)

Activity

  1. added
    enhancement
    on Nov 30, 2026
  2. tonibiocic commented on Nov 30, 2026

    @tonibiocic
    ContributorAuthor

    @VictorKildahl, I would like your help with the choice between the two variants. I lean towards the Dia dialog. If the Dia variant is OK with you, I will build it.

  3. VictorKildahl commented on Nov 30, 2026

    @VictorKildahl
    Owner

    @tonibiocic Please do a match of both :D

    We already use the Arc dialog many places, but i like the "It can" part of the dialog from dia.

  4. tonibiocic commented on Nov 30, 2026

    @tonibiocic
    ContributorAuthor

    @VictorKildahl then we have a deal 😇
    I know that if they were still working on Arc, it would look like Dia.

    We should make Arc 2027 one day :)

  5. VictorKildahl commented on Nov 30, 2026

    @VictorKildahl
    Owner

    @tonibiocic for sure, but that will be a separate overhaul all together ☺️

  6. tonibiocic commented on Nov 30, 2026

    @tonibiocic
    ContributorAuthor

    @VictorKildahl totally agree. I'm really grateful for how you translated the essence of Arc to Cra. It was never about the look, it was about the feel :)

  7. VictorKildahl commented on Dec 1, 2026

    @VictorKildahl
    Owner

    @tonibiocic

    How is this going my friend? :)

    Need any help?

  8. tonibiocic commented on Dec 1, 2026

    @tonibiocic
    ContributorAuthor

    Going well, thanks! It's built and tested here: an engine patch that hands Chromium's install prompt to the page's window, and Cra's sheet (Arc's dialog with Dia's "It can:" box) that asks that real prompt.

    On a locally built engine with the patch, the new scenario passes, and test.sh passes. I'm rebasing it onto 0.1.61 now and will open the PR as "Part of #998".

    The one thing I'll need from you is an engine build with the patch: until then the sheet can't get the real prompt, and the new scenario fails on the pinned engine. The PR text explains it.

  9. VictorKildahl commented on Dec 2, 2026

    @VictorKildahl
    Owner

    @tonibiocic's PR #1101 is on main, with the engine build it needed (159.0.8154.74-4).

    What was wrong: adding an extension always showed Chromium's own install dialog, which isn't Arc's and could come up clipped or on the wrong window (#349). Cra had no way to show its own, because the engine never handed the prompt to the app.

    What changed:

    • The engine now hands Chromium's real install prompt to the page's window first (cra-extension-install-prompt.patch), with Chromium's own half-second wait before Add Extension takes a click.
    • Cra answers it with Arc's sheet, with Dia's "It can:" box listing the permissions, in browser windows and Little Windows. Add Extension installs; Cancel, Esc or closing the window declines.
    • Anything other than a plain install (re-enabling, more permissions, an install from outside the store, a prompt Cra can't read) still gets Chromium's dialog, so nothing you agree to can drop out.
    • A .crx dropped on chrome://extensions and Settings ▸ Extensions ▸ Install from .crx File… (Support installing signed .crx files directly (Settings → Extensions / drag & drop), not only unpacked folders #1065) ask in the same sheet.

    Tests that lock it: ExtensionInstallAskTests (10 tests), DialogActionsTests.aHeldDefaultIsOffAndNothingElseIs, DialogPaletteTests.theInstallSheetsArrowAndBoxAreMixesOfTheInk, the DialogTests harness and the extension-install-dialog-drawn scenario, all tagged #998. The #593, #349 and #1065 scenarios now install through the sheet.

  10. VictorKildahl commented on Dec 2, 2026

    @VictorKildahl
    Owner

    Shipped in Cra 0.1.62: https://github.com/VictorKildahl/cra/releases/tag/v0.1.62. Cra updates by itself, or Cra ▸ Check for Updates… now. If something isn't right, reply here and I'll reopen it.

    Thank you @tonibiocic, for the idea and for building it in PR #1101.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementmac

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions