uazo / cromite

Cromite a Bromite fork with ad blocking and privacy enhancements; take back your browser!
https://www.cromite.org/
GNU General Public License v3.0
3.38k stars 74 forks source link

Check order of items in the text selection pop-up context menu #542

Closed uazo closed 6 months ago

uazo commented 10 months ago

Discussed in https://github.com/uazo/cromite/discussions/530

Originally posted by **drogga** November 15, 2023 I'm annoyed/bothered by the "Dictionary" item, which is the first button (option) in the text selection pop-up context menu on Samsung with A.11 _(IDK about other configurations...)_, that's not the case with/in `Bromite` on other devices and OS vers. too - please, either replace it with the `Web search` one _(which I actually have use for it and use it constantly/often, unlike the "Dictionary" one - never at all)_, or remove/move/bury it deep, to the last place, that should even be after the "Translate" ones, that appear if you have such apps installed, being by G., MS, Yandex or other. Huge thanks in advance ;) _I've searched, but didn't find any other discussion or an issue ticket (open & closed) regarding this problem (for me) specifically._
uazo commented 10 months ago

other strange thing: where are the other menu items?

Google Pixel 8 v14.0 (browserstack)

![image](https://github.com/uazo/cromite/assets/29201891/fdfdd935-8c1f-4d0b-af1d-6d6bb3febb51)

same in Google Pixel 7 v13.0 but not in Google Pixel 6 v12.0

uazo commented 10 months ago

see https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java

uazo commented 9 months ago

@drogga I checked. the first entry "Dictionary" for you, is given by the result of android's TEXT_CLASSIFICATION_SERVICE. those results are currently displayed with priority in chromium. the order is easily changed in the code, and probably we also need an option to turn off the android text classifier.

relative to https://github.com/uazo/cromite/issues/542#issuecomment-1825272770, the bug is different and is related to the lack of fre (first runtime execution) due to android's AppRestrictions policies.

uazo commented 9 months ago

so, the idea is this,

I also added new settings in the ui

drogga commented 9 months ago

I don't know which exactly accessibility service you mean, but I've never used it and I don't even know what it does or it's used for.

  1. Open Tab in Foreground (to jump immediately to it, just like if a site opened it, which is annoying in that case) > I might enable it.
  2. Web Search button as the first item > I will enable it (US English here).
  3. Web Search in tab group > I think I'll enable it.
  4. Smart Text Selection > I don't even know what it does and how it works.

Thanks. As long as they are not as flags, but options in the settings to toggle/enable, I'm fine with them all being disabled by default ;)

uazo commented 9 months ago

Smart Text Selection > I don't even know what it does and how it works.

is a system function that is active in some android devices. It allows the application to ask the system what to do in response to a user selection, e.g. it can extend its boundaries or detect a phone number and then allow it to be called directly from cromite. to work, it must send the context of the selection (and thus also the text) to a specific android service. external applications cannot be registered as recipients of that information, but it is only the operating system (aka google :)

drogga commented 9 months ago

I really hope that this will finally standardize / unify the text selection options and be the same no matter where and not differ from different places, like address bar, input (edit) fields and text selection ones everywhere else, but those that make sense ofc., because why would there be a Paste or Clipboard options on not input editable fields, but the Share or Paste as plain text and even Web Search ones don't have a reason IMO to be missing form an input field.

BTW, since it's also related to the text selection (IDK if it's not mentioned somewhere already), but I would like if there was a way without custom scripts or anything to block/disable the text selection restriction that some sites use/enforce, which is super dumb in my opinion, but I can kind understand why for news articles to fight against plagiarism & scrapers, but for sites like apkfab to block it for the changelogs/"what's new" is ridiculous, thankfully there are other browsers (not many) that have the option to block the blocking. Damn, how annoying is the text scroll in the newer Android versions from the address bar, when there's a long URL and you are trying to scroll it, but that no longer works, like in the older 10 or 9 and below OS versions and you have to do a text selection instead, which is also so slow and inconvenient with the selection handle(s)...
drogga commented 9 months ago

I've finally updated to v120.0.6099.217-c56a11a15b82c958469293ad3fe5721ef96d6431 (I was purposely waiting to see if any major issues will surface, before rushing to update) and with or without the Accessibility Service + Move web search to the top of items, the Dictionary item is still on the first place, then Web Search on second, then the third-party ones and the native ones are still on the last place, there's still no Web Search or Share on a text selection in an input field, where 2 3rd party items are still prioritized and it's a mess (I mainly blame Google or whoever is responsible for some of the pointless changes in Chromium, in which btw there's AFAIK a Zoom item on Android too - 3-dots context menu, which is missing here in Cromite and find it useful as it can also zoom-out to a negative, lower than 100%).

BTW a bit off-topic: IMO the release Assets file names should contain "Cromite" in them, instead of "Chrome".
uazo commented 8 months ago

the Dictionary item is still on the first place, then Web Search on second

how strange. can you tell me if your device is on this list on browserstack?

drogga commented 8 months ago

It's S20 FE with A.11, but I think it should be the same on any samsung with 10, 11, 12, 13, 14... BTW, Samsung used to have a developer site, where you could use a real devices remotely, which was driven by points, but IDK if it still works, because I haven't checked it for/since years. IDK how to get rid of the Dictionary, because there doesn't seems to be an obvious way without tinkering much with higher privileges and whatnot, not that this is a solution much, because it's not the only annoyance regarding those items, I wonder why those geniuses thought and decided it would be a good idea to break something that was working by changing those, I like how they are in Bromite...

Rant :I don't want to update on purpose, because everything after 11 is junk in one way or another, because of the stupid changes by G. and more and more restrictions with every new version and like ~1 useful change, which I can't even think of right now.
uazo commented 8 months ago

image

you are right, it doesn't work.