Skip to content

Fix the app menu entry for Chrome v154 - #310

Closed
matheuslive wants to merge 1 commit into
JingMatrix:chromium-compatfrom
matheuslive:chrome-154-menu
Closed

matheuslive wants to merge 1 commit into
JingMatrix:chromium-compatfrom
matheuslive:chrome-154-menu

Conversation

@matheuslive

Copy link
Copy Markdown

This builds on #306 and fixes the remaining menu failure reported in #308. On Chrome 154.0.8037.126 the hooks install and userscripts run with the chromium-compat branch, but the app menu entry is dropped with Cannot build a standard app menu item for the ChromeXt entries.

The cause is a rework of org.chromium.ui.modelutil.PropertyModel in M154:

  • Values are no longer boxed in a one field ValueContainer. The map holds the values themselves, and a key that was never written points to a shared sentinel, public static final Object on PropertyModel. Reading the first declared field of each value therefore returned garbage: no row had a String title, so no standard template was found, and menuIdNameOf returned null for every row.
  • The PropertyModel(List<PropertyKey>) constructor is gone. Only (Map, int) and the varargs (PropertyKey...) remain, so modelOfKeys was null.
  • The (key, value) setters are unchanged.

The fix tells the two formats apart by the presence of that static Object field. It unboxes only the old containers and builds the model through whichever key constructor exists, passing a typed PropertyKey[] to the varargs one. The page info overrides are written straight into the map when there is no container. The old path keeps its previous behaviour.

I tested it on a Samsung S20 FE (Android 13) with Chrome 154.0.8037.126. The Eruda console entry shows up after the third divider, and tapping it opens Eruda on the page. On 154 the icon row at the top of the menu no longer carries a page info entry, so the reader mode override simply finds nothing there and logs nothing. I have not re-tested older Chrome versions with this change.

Closes #308

M154 reworked PropertyModel: values are no longer boxed in a one field
ValueContainer but stored as they are, with a shared static sentinel
marking keys never written, and the PropertyModel(List) constructor is
gone in favour of the varargs PropertyModel(PropertyKey...) one. Reading
the first field of each value returned garbage, so no row looked like a
standard menu item and the ChromeXt entries were dropped with "Cannot
build a standard app menu item".

Detect the format through the sentinel, unbox only the old containers,
build the model through whichever key constructor exists, and write the
page info overrides straight into the map when there is no container.

Closes JingMatrix#308
@matheuslive

Copy link
Copy Markdown
Author

Also tested on Chrome Beta 156.0.8078.4 (Android 13): the "Eruda console" entry shows up in the app menu and opens Eruda, with no ChromeXt exceptions in the log.

@mvastola

Copy link
Copy Markdown

Any chance of generating a build for this so it can be installed?

@SainoNamkho

Copy link
Copy Markdown

Any chance of generating a build for this so it can be installed?

Manually trigger the workflow. I just ran a build: https://github.com/SainoNamkho/ChromeXt/actions/runs/38844598262

@JingMatrix

Copy link
Copy Markdown
Owner

Thanks for contribution, I believe it is solved in the merged (updated) pr #306.

@JingMatrix JingMatrix closed this Oct 21, 2026
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.

4 participants