Create a "Safari App Extension" for macOS application created with Electron? - macos

Since the release of "Safari App Extension" I have toyed around with creating safari app extensions for native applications using xcode. Now however, I'm attempting to create an extension for an application that was built using the Electron Framework.
I'm wondering if this is possible and if anyone has had any luck accomplishing this goal. I'm unsure how to go about initiating the safari app extension without the use of xcode.
For those unfamiliar with "Safari App Extension" you can add one to an existing native project by opening a MacOS application, going to "File->New->Target->Safari Extension" this will then create the extension within your existing application and make the extension available within Safari->Preferences->Extensions.
Thank you for reading.

I'm not secure if what I'm saying it's true, but I think that Safari Extensions are writed with Safari apis and/or a language that it isn't javascript (because, on my old Mac, I needed to install an adblocker app with .app extension). The problem is that Electron is based by Chromium and requires javascript and Chromium based extensions. If you want, however, you can do the inverse.
If you are not expert with Chromium extensions, I suggest to you this link.
P.S.: You can also try to find the same or similar extension that works on Chromium.

Related

Mac Catalyst, unable to create a Safari Extension

I've started a new iOS project enabling the option to deploy the same app in macOS (Catalyst). But when I try to create a Safari Extension in macOS, I get the following error
'Safari Extension.appex' is a Safari extension, which is not available when building for Mac Catalyst. You may need to restrict the platforms for which this app extension should be embedded in the target editor.
In the target editor Frameworks, Libraries and Embedded Content I've selected only the macOS platform in my Safari Extension, but I get the same error, any clue?
thanks for your time
I've received an answer from Apple
Embedding a Safari App Extension in a Catalyst app currently isn't
supported. If you could file a piece of Feedback in Feedback Assistant
that would be very helpful. Thanks!
https://forums.developer.apple.com/thread/122485

Why can I run my signed Safari App Extension on other computers, but not the one I developed it on?

I’ve started a Safari App Extension project, following Apple’s documentation.
I’ve got my (empty) app, and my very minimal extension. I’ve archived the app, signing it with my Developer ID. When I copied the archived app to a friend’s Mac, ran it, and launched Safari, the app extension showed up in the Extensions pane of Safari’s preferences (with the parent app’s icon), and when enabled, worked fine.
However, when I run the app on my Mac (where I developed it), and launch Safari, the app extension does not show up in Safari’s Extensions preference pane unless I check “Allow Unsigned Exceptions” in Safari’s develop menu, as described in this answer — and when it does, it has a generic app icon, rather the parent app’s icon.
Although I hope to eventually make the app and the app extension available to other people, I’m mainly making it for myself. As such, I’d like to be able to use it without having to check “Allow Unsigned Exceptions” every time I start Safari.
How can I make the app extension show up in Safari’s Extensions preference pane on the computer I develop the extension on?
I found a debug version of my app and app extension in my user Library folder:
~/Library/Developer/XCode/DerivedData/{APP_NAME_FOLLOWED_BY_LONG_STRING}/Build/Products/Debug
After deleting the contents of this folder, restarting Safari, and allowing unsigned extensions again, my app extension no longer appeared with the generic icon in Safari’s Extensions preferences.
(I’m a real Xcode newbie, so I’ve no idea if deleting debug builds is a thing that I can/should do via Xcode instead.)
I then archived my app again and ran it, then restarted Safari. Now my app extension shows up in Safari’s Extensions preferences, with its proper icon and everything, and stays enabled between restarts.

How to create extension for Safari without release the app?

I now want to write extension for Safari.
But xCode offers me first make the app, and then add the safari extension.
OK, I created an empty application, started writing my extension, but I have a question. Can I release an extension without reference to the application? I do not understand the process.
I want to just create a safari extension, without reference to a particular application, because my product is a Safari extension, not a application.
I know it's late but somebody else might stumble upon this topic and I think the following information can be useful.
It seems that according to Apple's documentation extensions that are created using Safari Extension Builder will not longer be supported: https://developer.apple.com/library/archive/documentation/Tools/Conceptual/SafariExtensionGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009977-CH1-SW1
Developer-signed Safari extensions are not supported in Safari 12. Safari extensions distributed in the Safari Extension Gallery are deprecated, and Safari 12 is the last release to support them. Safari by default will turn off Safari extensions using canLoad. Instead, use Content Blocker extensions. New submissions to the Safari Extensions Gallery will be accepted until the end of 2018.
So the only way seems to be to
Use Safari app extensions to add features to the Safari browser.
https://developer.apple.com/documentation/safariservices/safari_app_extensions:
this looks like the only way to develop an extension as of today (2018), alas.
There are 2 types of Safari extensions: ones that bundled with a Mac app (Safari App Extensions) and standalone extensions. I belive standalone extensions can be created using Safari Extension Builder (avaliable in Develop menu in Safari), without Xcode. You can learn more about Safari extensions here.
As Safari extension Builder is deprecated, you now use Xcode. Simply, a Safari Extension can either be bundled with an app, or standalone. To start a new standalone extension, that is, not part of a desktop app:
Launch Xcode
Choose File > New > Project
Select the template Safari Extension App in the Other section
Click Next (continue through the normal process to develop your Safari Extension)
Alternatively, if you wanted to add a Safari Extension to your existing project:
Launch Xcode
Open your existing app project
Choose File > New > Target
Select the template Safari Extension App in the Other section
Click Next (continue through the normal process to develop your app including Safari Extension)
An example might be Grammarly whereby you can download a desktop client and Safari extension (in a bundle) for macOS, or you may download the extension as a standalone app from App Store.

OSX Today Extension without containing app

I'm not understanding if a containing app is needed alongside a Today Extension for OSX. I have a very simple and straightforward widget, it does not need nor rely on a main or containing app. With that said, how can I create an Today Extension without a containing app.
What I have so far is that I have a blank app with a today extension.
You cannot create a today extension without having an app. They don't work that way. All iOS app extensions are just that-- extensions to an app. There must be an app, and it must do something to be accepted into the app store (Apple rejects apps for "minimal functionality"). Extensions cannot exist on iOS outside of an app bundle, until or unless Apple decides to change things in the future.
A container app is not needed. Read up the Apple documentation on it. It says:
To deliver an OS X app extension, it’s recommended that you submit your containing app to the App Store, but it’s not required.

Testing apps on a Firefox OS Phone Device

I have the Keon from geeksphone. The Mozilla developer site talks about using the emulator, but nothing about installing an application onto a physical device. It is a developer phone, so I assume there's a way to develop with it? I can host the app and test it in the phone's browser, but I'd prefer trying to package it up and actually install it onto the device.
Found it. Now I need to figure out how to install an XPI file...
Testing Packaged Apps
Android bridge API
Now I need to figure out how to install an XPI file...
XPI files are add-ons, which FirefoxOS does not support at the moment.
You want to install FirefoxOS Simulator addon file which is in .xpi format? If yes then just drag and drop the file onto Firefox Browser, it will get installed.

Resources