Easydict icon indicating copy to clipboard operation
Easydict copied to clipboard

Arc Browser: Insert doesn't work from "Select Translate"

Open simonbcn opened this issue 1 year ago • 6 comments

Please confirm the following:

  • [X] Be sure to check out FAQ
  • [X] I have carefully read the README
  • [X] I have searched through the issues page but couldn't find a solution.(Including issue that has been closed)
  • [X] Easydict has been upgraded to the latest version
  • [X] I understand and agree to the above, and understand that the project maintainer has limited energy, issues that do not follow the rules may be ignored or closed directly

Problem description

Arc Browser. When I select text within an input field and press the icon or key combination for "Select Translate", the mini-window with the translation opens and there is a button that allows me to replace the selected text with the translation but it does nothing.

Is the issue consistently reproducible?

Reproducible

Steps to Reproduce

Arc Browser. When I select text within an input field and press the icon or key combination for "Select Translate", the mini-window with the translation opens and there is a button that allows me to replace the selected text with the translation but it does nothing.

Screenshot

Captura de pantalla 2024-07-28 a las 9 19 35

Expected result

It should replace the selected text with the translation.

Proposed solution (optional)

No response

Device type and OS version

macOS 14.5

Are you willing to submit a PR to fix this issue?

  • [ ] I'm willing to submit a PR

simonbcn avatar Jul 28 '24 07:07 simonbcn

Hello simonbcn, Thank you for your first issue contribution 🎉

github-actions[bot] avatar Jul 28 '24 07:07 github-actions[bot]

I'm not using Arc Browser, @Jerry23011 can you help look at this?

tisfeng avatar Jul 28 '24 15:07 tisfeng

I can reproduce the issue. e.g. On google.com, input “test” in the search field, then select text, and replace with translated text. Works on Safari but not Arc

Jerry23011 avatar Jul 29 '24 13:07 Jerry23011

Arc Browser behaves strangely, it may not support Accessibility, I will try to fix it later 😓

tisfeng avatar Jul 29 '24 16:07 tisfeng

Arc Browser is based on Chromium, like most current browsers.

simonbcn avatar Jul 30 '24 14:07 simonbcn

I tested and found that using the Accessibility method to replace translations on Arc Browser returns successful results, but the actual replacement operation fails, which is strange. It behaves differently from Chrome in some ways.

I added an option to ensure that replacement is successful on Arc Browser https://github.com/tisfeng/Easydict/pull/624 .

tisfeng avatar Jul 30 '24 15:07 tisfeng

Version 2.8.0 has fixed this issue.

tisfeng avatar Aug 12 '24 16:08 tisfeng

It still fails.

simonbcn avatar Aug 17 '24 06:08 simonbcn

Turn on Replace translation with compatibility mode in advanced settings @simonbcn

Jerry23011 avatar Aug 17 '24 06:08 Jerry23011

It doesn't work either. Paste the content into the easydict application window:

Captura de pantalla 2024-08-17 a las 9 18 45

simonbcn avatar Aug 17 '24 07:08 simonbcn

Could you give me the website that didn’t work for you?

Jerry23011 avatar Aug 17 '24 07:08 Jerry23011

This: github.

simonbcn avatar Aug 17 '24 07:08 simonbcn

It works for me. Could you upload a screen recording to reproduce the issue? Thanks

https://github.com/user-attachments/assets/514024b3-0b53-4ec4-9499-1d644cb9bb1c

Jerry23011 avatar Aug 17 '24 07:08 Jerry23011

https://github.com/user-attachments/assets/a4cb6017-67aa-4d35-9a73-e963a16b8001

simonbcn avatar Aug 17 '24 08:08 simonbcn

CC @tisfeng Not sure what's going on here. I can't reproduce the issue with the exact same operations.

@simonbcn Meanwhile, I suggest uninstalling Easydict completely (including the cache, config files, and permission settings) and reinstall it to see if the issue persists. This is to see if the issue happens due to an environment variable on your local macOS.

Jerry23011 avatar Aug 17 '24 08:08 Jerry23011

@simonbcn First, make sure you have the "Use Replace with Translation in compatibility mode" option turned on.

Also, could you please provide the Easydict log zip file(menu icon -> Help -> Export log) and we'll check it out.

99367

tisfeng avatar Aug 17 '24 15:08 tisfeng

I watched the video carefully and noticed a strange point: after clicking the replace button, the Easydict window should be hidden automatically (this is very important), just like shown in @Jerry23011's video.

@simonbcn I'm not sure why your window didn't hide; can you check it?

tisfeng avatar Aug 17 '24 15:08 tisfeng

I have uninstalled the application with CleanMyMac. I have done a search on the disk for "easydict" and I have deleted the folders/files that had that name. I have restarted the system and reinstalled the application, now it works correctly.

simonbcn avatar Aug 18 '24 06:08 simonbcn

Great to hear that! This could be caused by a data race error where user data is corrupted. We might want to migrate the project to Swift 6 in the future to prevent that.

Jerry23011 avatar Aug 18 '24 07:08 Jerry23011

I found that I had to turn on the forced word option to successfully open the translation button in Arc browser.

MilchstraB avatar Aug 20 '24 03:08 MilchstraB

No, testing on my computer, Arc supports Accessibility to obtain selected text, which means that it can work without enabling forced word retrieval.

I rarely use Arc and am not familiar with it, so I'm not sure if there is a problem with Arc, because I found that some of its behaviors are different from Chrome, for example, https://github.com/tisfeng/Easydict/issues/622#issuecomment-2256359689.

tisfeng avatar Aug 20 '24 13:08 tisfeng

Thanks for your reply! My question is shown in the video. The machine I used was the M2 Macbook Air with MacOS 14.6.1, Arc Browser 1.56.0 and Easydict 2.8.1.

https://github.com/user-attachments/assets/6f128c5f-d349-4648-95b1-93f5c962e261

MilchstraB avatar Aug 20 '24 14:08 MilchstraB

Very interesting. It works on my end as well without enabling force get text.

@MilchstraB How about try resetting your Easydict Accessibility permissions.

I'm on macOS 14.6.1 | Easydict 2.8.1 | Arc 1.56.0

https://github.com/user-attachments/assets/858b2e06-cb46-4b31-8800-166de65d18cd

Jerry23011 avatar Aug 20 '24 14:08 Jerry23011

It's very interesting. I tried to reinstall the APP and reset the permissions for word translation, and only the button that turns on the forced text selection seemed to work for me. If this option is not turned on, text cannot be correctly selected in the sidebar even if the shortcut option + D is used. However, it has little effect on use.

MilchstraB avatar Aug 20 '24 15:08 MilchstraB

@MilchstraB You can upload the Easydict zip runtime log. It might be helpful.

tisfeng avatar Aug 22 '24 13:08 tisfeng