Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension no longer available in Safari #1002

Open
cookieo opened this issue Oct 16, 2022 · 11 comments
Open

extension no longer available in Safari #1002

cookieo opened this issue Oct 16, 2022 · 11 comments
Assignees

Comments

@cookieo
Copy link

cookieo commented Oct 16, 2022

It has disappeared from the tool bar and does not appear as an extension in safari preferences. When I try to download from the App Store, I just get a button that says "Quit and Open Safari Extensions Preferences". I click this and nothing happens. I also quit the App Store and open safari extensions and 10ten is not there.

This is a bit confusing.

@birtles
Copy link
Member

birtles commented Oct 16, 2022

Oh, I've seen that before when developing. As best I can tell, it seems to be a problem with Safari. I can normally get it to work by completely closing Safari (and the 10ten app) and then re-installing. I'm really sorry for the trouble, I'm not sure what it going on, but I think it's a Safari bug.

@cookieo
Copy link
Author

cookieo commented Oct 16, 2022 via email

@birtles
Copy link
Member

birtles commented Oct 16, 2022

Hi, thanks for that, but how do I re-install? I quit both Safari and 10ten, open the app store, get an “open” button on the app store and then the “quit and open extensions” button, but nothing happens. 10ten is not available in safari extensions.

Oh, good question. I'm really unfamiliar with Macs so I don't know how you normally uninstall programs. (When I am developing, uninstalling normally just means stopping Xcode.) Can you drag it from Application to the trash can?

@cookieo
Copy link
Author

cookieo commented Oct 16, 2022 via email

@birtles
Copy link
Member

birtles commented Oct 16, 2022

I'm afraid I can't see the screenshot I think you sent.

The button is the default text and code from the Safari Extension template. It means to quit the native extension "app" (which does basically nothing except show that button).

Do you happen to know which version of Safari you have?

@cookieo
Copy link
Author

cookieo commented Oct 16, 2022 via email

@birtles
Copy link
Member

birtles commented Oct 17, 2022

Thanks for that. I'm afraid I don't have any particularly good ideas. Maybe @shirakaba can help?

@shirakaba
Copy link
Collaborator

shirakaba commented Oct 17, 2022

@cookieo This does smell like a Safari bug - Web Extensions in Safari are implemented as macOS App Extensions that wrap around the actual Web Extension bit (and furthermore a macOS app that wraps around the App Extension bit), so they have some extra failure points compared to other browsers.

If it's not appearing in the Safari window's menubar, then it would seem that it hasn't been enabled in the list of Web Extensions under Safari > Preferences... > Extensions. However, as you've found, it's not even visible in that list, which is unexpected.

For it to not be in the list, it would seem that it hasn't been installed ("installation" is defined as the 10ten Japanese Reader.app having been added into your Applications folder, and having been trusted by the OS). However, as you've installed it via the App Store and you appear to be able to open the (yes, very minimal) app just fine (proving that macOS trusts it), it implies that something elsewhere in the macOS infrastructure has gone wrong.

I think this sounds like the same problem that Ghostery encountered with their Web Extension. Here's something I spotted in their FAQ:

Why can't I find Ghostery in the Safari Extension list?

There seems to be a bug in Safari causing this. Please run the following command in the terminal to fix it:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/Safari.app

I think it's worth a try, though first I'd like to get a bit more familiar with lsregister to understand what it's doing. First, with reference to this article let's print out all the entries in LaunchServices.

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump

Here's my output for that command (which we'll call healthy, as 10ten Japanese Reader is working for me). Note that in this sample, I've excluded a bunch of irrelevant entries between the bundle and the extension as it's a very long file:

My lsregister output for 10ten Japanese Reader
  --------------------------------------------------------------------------------
bundle id:                  10ten Japanese Reader (0x5124)
class:                      kLSBundleClassApplication (0x2)
container:                  / (0x4)
mount state:                mounted
Mach-O UUIDs:               15BAE53B-4B17-3613-BC0E-689A8B7FC3D7, 48395C03-44C6-35E3-BCB9-E3D3D1093D40
sequenceNum:                20772
itemID:                     1573540634
path:                       /Applications/10ten Japanese Reader.app (0xe640)
directory:                  /Applications
name:                       10ten Japanese Reader
displayName:                10ten Japanese Reader
localizedNames:             "Base" = ?, "en" = ?, "LSDefaultLocalizedValue" = "10ten Japanese Reader"
localizedShortNames:        "Base" = ?, "en" = ?, "LSDefaultLocalizedValue" = "10ten Japanese Reader"
itemName:                   10ten Japanese Reader
teamID:                     H3RB7C8768
storeFront:                 143444
versionID:                  852264979
ratingLabel:                12+
ratingRank:                 300
category:                   public.app-category.reference (0x290e8)
identifier:                 jp.co.birchill.tenten-ja-reader
vendor:                     Birchill, Inc.
version:                    50.0 ({length = 32, bytes = 0x32000000 00000000 00000000 00000000 ... 00000000 00000000 })
versionString:              50
displayVersion:             1.12.5
mod date:                   2022-10-03 10:30 (POSIX 1664760649, 𝛥 2wks 6hr 29min 39sec)
reg date:                   2022-10-17 16:51 (POSIX 1665993110, 𝛥 8min 38sec)
rec mod date:               2022-10-17 16:51 (POSIX 1665993110, 𝛥 8min 38sec)
type code:                  'APPL' (4150504c)
creator code:               '????' (3f3f3f3f)
bundle flags:               has-display-name  is-containerized  MASReceipt (0080004000000002)
plist flags:                has-protected-metadata (0000000000400000)
icon flags:                 relative-icon-path  supports-asset-catalog (0000000000000005)
slices:                     x86_64  arm64 (0000000000000088)
item flags:                 package  application  container  native-app  extension-hidden (000000000010008e)
App Nap:                    capable (0000000000000001)
eGPU:                       capable  can-change (0000000000000005)
safeAperture system fullscreen: capable  can-change (0000000000000005)
safeAperture app fullscreen: capable  can-change (0000000000000005)
safeAperture windowed:      capable  can-change (0000000000000005)
platform:                   native
iconName:                   AppIcon
iconDict:                   1 values (144420 (0x23424))
                            {
                                CFBundlePrimaryIcon =     {
                                    CFBundleIconFile = AppIcon;
                                    CFBundleIconName = AppIcon;
                                };
                            }
icons:                      Contents/Resources/AppIcon.icns
executable:                 Contents/MacOS/10ten Japanese Reader
inode:                      8284460
exec inode:                 8284501
min version:                10.14 ({length = 32, bytes = 0x0a000000 00000000 0e000000 00000000 ... 00000000 00000000 })
min version platform:       native
execSDK ver:                12.3 ({length = 32, bytes = 0x0c000000 00000000 03000000 00000000 ... 00000000 00000000 })
mach min ver:               10.14 ({length = 32, bytes = 0x0a000000 00000000 0e000000 00000000 ... 00000000 00000000 })
infoDictionary:             17 values (144424 (0x23428))
                            {
                                CFBundleDevelopmentRegion = en;
                                CFBundleDisplayName = "10ten Japanese Reader";
                                CFBundleExecutable = "10ten Japanese Reader";
                                CFBundleIconFile = AppIcon;
                                CFBundleIconName = AppIcon;
                                CFBundleIdentifier = "jp.co.birchill.tenten-ja-reader";
                                CFBundleInfoDictionaryVersion = "6.0";
                                CFBundleName = "10ten Japanese Reader";
                                CFBundlePackageType = APPL;
                                CFBundleShortVersionString = "1.12.5";
                                CFBundleSignature = "????";
                                CFBundleSupportedPlatforms =     (
                                    MacOSX
                                );
                                CFBundleVersion = 50;
                                NSAccentColorName = AccentColor;
                                NSMainStoryboardFile = Main;
                                NSPrincipalClass = NSApplication;
                                protectedMetadata = {length = 785, bytes = 0x0003f764 dd3f4111 756a0623 895d17b3 ... c91a8757 35280707 };
                            }
activityTypes:              NOTIFICATION#H3RB7C8768:jp.co.birchill.tenten-ja-reader, pv-de37c27e1c5640
plugin Identifiers:         jp.co.birchill.tenten-ja-reader.Extension
entitlements:               5 values (144428 (0x2342c))
                            {
                                "com.apple.application-identifier" = "H3RB7C8768.jp.co.birchill.tenten-ja-reader";
                                "com.apple.developer.team-identifier" = H3RB7C8768;
                                "com.apple.security.app-sandbox" = 1;
                                "com.apple.security.files.user-selected.read-only" = 1;
                                "com.apple.security.network.client" = 1;
                            }
  --------------------------------------------------------------------------------
plugin id:                  10ten Japanese Reader Extension (0x17e0)
container:                  / (0x4)
mount state:                mounted
isOnRootVolume:             true
isSystemManaged:            true
Mach-O UUIDs:               3B31D449-C820-32D8-8608-9629DFDBF2B5, 1565D17F-B432-36B9-A34E-4117D987C628
platform:                   native
slices:                     x86_64  arm64 (0000000000000088)
identifier:                 jp.co.birchill.tenten-ja-reader.Extension
bundleID:                   jp.co.birchill.tenten-ja-reader.Extension
teamID:                     H3RB7C8768
name:                       10ten Japanese Reader Extension
displayName:                10ten Japanese Reader Extension
localizedNames:             "en" = ?, "LSDefaultLocalizedValue" = "10ten Japanese Reader Extension"
localizedShortNames:        "en" = ?, "LSDefaultLocalizedValue" = "10ten Japanese Reader Extension"
parent:                     10ten Japanese Reader (0x5124)
path:                       /Applications/10ten Japanese Reader.app/Contents/PlugIns/10ten Japanese Reader Extension.appex (0xe644)
directory:                  /Applications
EP:                         com.apple.Safari.web-extension (0x78c0)
raw EPID:                   com.apple.Safari.web-extension
EPNAME:                     com.apple.Safari.web-extension
version:                    1.12.5 ({length = 32, bytes = 0x01000000 00000000 0c000000 00000000 ... 00000000 00000000 })
sdkVersion:                 12.3 ({length = 32, bytes = 0x0c000000 00000000 03000000 00000000 ... 00000000 00000000 })
UUID:                       B8EA2166-50CD-46EA-BF66-1354FE88392C
reg date:                   2022-10-17 16:51 (POSIX 1665993110, 𝛥 8min 38sec)
entitlements:               2 values (144432 (0x23430))
                            {
                                "com.apple.security.app-sandbox" = 1;
                                "com.apple.security.files.user-selected.read-only" = 1;
                            }
PKDict:                     20 values (144436 (0x23434))
                            {
                                BuildMachineOSBuild = 21G83;
                                CFBundleDevelopmentRegion = en;
                                CFBundleDisplayName = "10ten Japanese Reader Extension";
                                CFBundleExecutable = "10ten Japanese Reader Extension";
                                CFBundleIdentifier = "jp.co.birchill.tenten-ja-reader.Extension";
                                CFBundleInfoDictionaryVersion = "6.0";
                                CFBundleName = "10ten Japanese Reader Extension";
                                CFBundlePackageType = "XPC!";
                                CFBundleShortVersionString = "1.12.5";
                                CFBundleSupportedPlatforms =     (
                                    MacOSX
                                );
                                CFBundleVersion = 50;
                                LSExecutableFormat = LSExecutableMachOFormat;
                                LSExecutableMinimumOSVersion = "10.14";
                                LSExecutablePlatformKey = 1;
                                LSExecutableSDKVersion = "12.3";
                                LSMinimumSystemVersion = "10.14";
                                MachOUUIDs =     (
                                    "3B31D449-C820-32D8-8608-9629DFDBF2B5",
                                    "1565D17F-B432-36B9-A34E-4117D987C628"
                                );
                                NSExtension =     {
                                    NSExtensionAttributes =         {
                                        NSExtensionVersion = "1.12.5";
                                    };
                                    NSExtensionPointIdentifier = "com.apple.Safari.web-extension";
                                    NSExtensionPrincipalClass = "_0ten_Japanese_Reader_Extension.SafariWebExtensionHandler";
                                };
                                NSHumanReadableCopyright = "";
                                Path = "/Applications/10ten Japanese Reader.app/Contents/PlugIns/10ten Japanese Reader Extension.appex";
                            }
SDKData:                    2 values (132632 (0x20618))
                            {
                                NSExtension =     {
                                    NSExtensionAttributes =         {
                                        NSExtensionPointName = "com.apple.Safari.web-extension";
                                        NSExtensionPointVersion = "1.0";
                                    };
                                    NSExtensionHostEntitlement = "com.apple.private.can-load-any-content-blocker";
                                    NSExtensionProtocol = NSObject;
                                    PrincipalClass = NSObject;
                                    Subsystems =         (
                                        "NSSharingService_Subsystem"
                                    );
                                    "com.apple.showsInExtensionsManager" = 0;
                                };
                                XPCService =     {
                                    JoinExistingSession = 1;
                                    RunLoopType = NSRunLoop;
                                    ServiceType = Application;
                                    "_AdditionalSubServices" =         {
                                        "apple-extension-service" = 1;
                                    };
                                };
                            }

In order to help us debug this situation in future, could you please run that same command and show what those two entries look like for you? My suspicion is that that it might be showing just one entry for you - the app, but not the app extension. That, or the entry for the app extension on your side is corrupted.

After providing that information, I think you'd just need to run this (the exact command suggested by the Ghostery developers) to force an update of applications registered with the Launch Services database with respect to Safari.

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/Safari.app

@cookieo
Copy link
Author

cookieo commented Oct 17, 2022 via email

@shirakaba
Copy link
Collaborator

shirakaba commented Oct 18, 2022

@cookieo I think the lsregister command above is a perfectly safe one-liner to run (and in particular, I trust the Ghostery folks), but if it's a bit daunting, then I have some guesses we could try:

  1. You could try right-clicking any .html file in your desktop and choosing "Get Info". That'll bring up this menu:
    image
    My thinking is that maybe if you changed "Open with: Safari (default)" to some other web browser like Firefox, then clicked "Change All..." to apply to all HTML files, then change it back, it might force a reload of Safari's associated launch services (which is what we're aiming for).
  2. You could equally try installing another Web Extension into Safari (e.g. Ghostery) to see if that refreshes things.
  3. The next time a macOS update comes (it might have to concern Safari) it may self-resolve.
  4. You could try installing Safari Technology Preview. I'm not sure whether it shares the same extensions list as Safari or maintains its own individual one, but if you're lucky, installing it might even get Safari to work.

But we're happy to see it used on Firefox either way!

@cookieo
Copy link
Author

cookieo commented Oct 18, 2022 via email

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

No branches or pull requests

3 participants