Apple is strongly encouraging extension developers to submit their extensions to the Safari Extensions Gallery.
If you distribute your extension from your own site, the install process for users is suboptimal, and there are multiple "Trust" dialogs that users have to consent to.
As far as I'm aware, all that can be done from your own website for Safari is:
1. Detect that the browser is Safari.
Although browser detection is not 100% effective, and feature-based detection is preferred, in this case you can follow up your effective feature-based detection of Chrome and Firefox with a simple, fairly effective test for Safari (the key being the check on navigator.vendor):
var isSafari = /Apple Computer/.test(navigator.vendor) && /Safari/.test(navigator.userAgent);
Alternatively, you can use one of the more complex browser detection scripts that handles minor browsers as well.
2. Optionally detect the version of Safari
If you need functionality available in a specific release of Safari, you can optionally follow this with a browser version check.
function getSafariVersion() {
var index = navigator.userAgent.indexOf("Version");
if (index == -1) return;
return parseFloat(navigator.userAgent.substring(index+"Version".length+1));
}
Note: If the user has altered their browser's User-Agent, this check will not be accurate.
3. Offer the .safariextz for download, and ask the user to open it.
Link to the extension bundle, encourage the user to download it, and provide instructions (and ideally screenshots) of the manual install process.
(This is what 1Password does on their extension install page.)
Bonus:
To handle the case where users already have your extension installed, there are various methods to detect whether your Safari extension is installed from your website.