If you install a Safari Extension, are you able to see its source code? It is great to verify that the extension does not contain malware.
One can do it with Chrome as described in this blog
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Locate the extension. It should be living in your library folder. Note this is a hidden folder so in the finder use Command+Shift+G to put in this location
~/Library/Safari/Extensions. Here you’ll see the Safari extensions you have installed. They have a
.safariextfile extension, but this is really just a xar file.
To extract the extension’s files, use this command (replacing the '/path/to' with the correct path and the 'extension.safariextz' with the correct name)
xar -xf /path/to/extension.safariextzThe extension will be extracted into a folder, with the source and resources contained within.
If you want to change something and then package it back up for reinstallation, you can xar the folder back into a single file using
xar -c -f output.safariextz extensionFolder.
I'm running 10.15.6 and these steps worked for me.
Since Safari 13, all extensions must be downloaded from the App Store as
.app bundles with
.appex files inside them. Both of them are built in Xcode thus you only get the final executable. So if the extension is not open source, you cannot see what's in the binary
A simple way to understand how the app and extension interact, see the following. (Note that it's an Xcode extension, not Safari. )