themoeway / yomitan

Japanese pop-up dictionary browser extension. Successor to Yomichan.
https://chromewebstore.google.com/detail/yomitan/likgccmbimhjbgkjambclfkhldnlhbnn
GNU General Public License v3.0
989 stars 76 forks source link

[Help request]: Trying to add Safari support by running `xcrun safari-web-extension-converter` on yomitan #949

Closed jamesmaa closed 2 months ago

jamesmaa commented 2 months ago

Can someone try to do this on their mac and report back their results on whether yomitan would work on their safari?

Documentation: https://developer.apple.com/documentation/safariservices/safari_web_extensions/converting_a_web_extension_for_safari/

Another blog post about the process: https://iboysoft.com/tips/convert-chrome-extension-to-safari.html

Related: #66

ellieglad commented 2 months ago

Attempted to do this, following the documentation, and the results are the same as in #66 . Noted issues: Yomitan seems to correctly scan the text, but the results popover is not appearing, despite disabling both Use a secure container around popups and Use secure popup frame URL.

Enable background clipboard text monitoring is also not permitted to be enabled, this might be due to having to grant new entitlements after converting to a safari web extension.

I could also not get the import dictionary collection option to work, as it hung partway into importing. Importing a few individual dictionaries seemed to work, though I did not check if it also started hanging after a certain amount of dictionaries were imported.

My expectation is that some of this is tied up in how safari/apple entitlements work and some things that would require a deeper look or adjustments.

Some additional details from the conversion command:
Running macOS sonoma 14.4.1

App Name: Yomitan
App Bundle Identifier: com.yourCompany.Yomitan
Platform: All
Language: Swift
Warning: The following keys in your manifest.json are not supported by your current version of Safari. If these are critical to your extension, you should review your code to see if you need to make changes to support Safari:
    clipboardRead
    match_about_blank
    offscreen
    type
    sandbox
    open_in_tab
jamesmaa commented 2 months ago

Thank you for investigating this! Could you post your findings in #66 while I close out this issue (that I'm treating as a task)?

ellieglad commented 2 months ago

Done!