Questions tagged [safari-app-extension]

Safari app extensions leverage web technologies and native code to extend the web-browsing experience in Safari

Safari app extensions leverage web technologies and native code to extend the web-browsing experience in Safari.

Safari app extensions are available in OS X 10.12 and later and in OS X 10.11.5 when Safari 10 is installed. Using a Safari app extension, you can add new functionality to Safari, read and modify web page content, and communicate with your native application to integrate its content into Safari or send web data to your app.

Safari app extensions are written using a combination of JavaScript, CSS, and native code written in Objective-C or Swift. Safari app extensions are built on the standard app extension model.

Docs: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/SafariAppExtension_PG/

89 questions
3
votes
3 answers

Safari App Extension doesn't load second time

I've been having a strange issue where the second time I run my Safari app extension, it won't show up in Safari. Open Xcode. New > Project. Under Other, select Safari Extension App, then click "Next". Enter whatever you want on this "product name"…
Kevin Ghadyani
  • 6,829
  • 6
  • 44
  • 62
3
votes
3 answers

How to troubleshoot when Safari App Extension not appear in Safari Preferences?

I'm developing a Safari App Extension. Previously it worked fine. When I run the project in Xcode, and enable Allow Unsigned Extensions in Safari, I can see my extension in Safari Preferences -> Extensions page. After I merged code with one of my…
zhm
  • 3,513
  • 3
  • 34
  • 55
3
votes
1 answer

Mac app extension calling connect on Unix socket gets EPERM (sandbox?)

I'm working on a large-ish Mac app, which is split across many components in many different processes. One of those components is a Safari Extension Companion[1], which is is a kind of "App Extension" that allows a JavaScript -based extension to…
CBHacking
  • 1,984
  • 16
  • 20
3
votes
3 answers

Can you distribute a Safari App Extension *outside* the Mac App Store?

The App Extension Programming Guide says this: 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. And the Safari App Extension Programming Guide says this: Safari app…
TheNextman
  • 12,428
  • 2
  • 36
  • 75
2
votes
1 answer

Safari Web Extension horribly slow

So I created a Safari Web Extension. I did not change any piece of code and ran the template code provided by Xcode. I clicked on the toolbar item and a blank popover window popped up. It took around a good 5 seconds to load the "Hello World!"…
2
votes
1 answer

Check if tab/page is pinned in Safari App Extension

I am writing a Safari App Extension which gets all open tabs as urls. Later I want to open them. The problem I am facing is that I cannot find an API for checking if a tab (page) is pinned. This leads to the problem that opening all gathered urls…
o15a3d4l11s2
  • 3,969
  • 3
  • 29
  • 40
2
votes
1 answer

How to call the popover to show up in Safari app extension?

I am developing a safari app extension with swift in xcode. In my SafariExtensionHandler.swift, I declared a func: override func popoverViewController() -> SFSafariExtensionViewController { return SafariExtensionViewController.shared …
yuan
  • 1,701
  • 2
  • 13
  • 24
2
votes
3 answers

How can I identify tab (or get its id) in Safari App Extension?

I am developing an Safari App Extension and I would like to identify opened tab. I found no id or no way to do that. Chrome has an awesome API for doing that: https://developer.chrome.com/extensions/tabs. How can I do it with Safari App Extension…
Tchoupinax
  • 235
  • 3
  • 12
2
votes
1 answer

How to open app window on toolbar click in safari app extension?

I'd like to open an application/extension Window when user clicks toolbar item in safari. This is not question about extension's Popover feature. The main reason is to close/hide the window on deactivation AND user action (both conditions are…
Michal Roharik
  • 141
  • 1
  • 8
2
votes
2 answers

How can I develop Safari App Extension without macOS app?

I've just developed a brand new Safari App Extension. I do not have any mac os app to share through the mac app store, only my extension THAT IS my product. It seems (from that Apple page) that I must create a dummy mac os app to share my extension…
2
votes
1 answer

Ways of Safari App Extension to communicate with containing app

I have a Safari App Extension that injects a button over images into a specific website and when tapping that button I want to trigger a function with some parameters in the application that contains the safari app extension (NOT from .js to…
Silviu St
  • 1,810
  • 3
  • 33
  • 42
2
votes
3 answers

Is there a way to change the name of a Safari app extension in Xcode?

I have created a Safari app extension through an Xcode target that I want to change the name of. Initially, when creating the Xcode target, I simply called it "Safari Extension", thinking that I would be able to change it easily later. I thought…
2
votes
1 answer

Open new tab with JavaScript in Safari 12 [Safari App Extension]

I have this extension where I want to open a new tab in the JavaScript part of the extension. Before migrating it to a Safari App Extension I could just do window.open(url, "_blank"); But when I run this in Safari 12 as an App Extension it adds the…
simeg
  • 1,889
  • 2
  • 26
  • 34
2
votes
0 answers

How to get the state(enabled/disabled) of safari content blocker app extension from safari toolbar item app extension?

I am developing the mac app with Safari Content Blocker and Safari Toolbar Item extensions. I am able to get the state of Content Blocker extension (enabled/disabled) in Safari from the mac app (Containing App), and able to display the warning…
Kevin Adesara
  • 3,830
  • 1
  • 17
  • 18
2
votes
1 answer

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,…
Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270