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
0
votes
0 answers

Safari app extension error "Inspection enabled ... for ... application with 'com.apple.security.get-task-allow' entitlement linked against old SDK"

I'm experimenting with Safari app extension (not Safari web extension) for the first time, and the template Hello World app that is created after setting up the Xcode project stopped working, I suspect after a macOS updates (current environment:…
P.T.
  • 13
  • 4
0
votes
0 answers

Safari stops responding when my extension tells it to load a complicated website

i'm writing a Safari App Extension in Objective C. I use a script.js for the content script. (The entire script.js follows the end of this question). The procedure document.addEvent.... works every time. From time to time I send a string url to…
Carl Carlson
  • 500
  • 4
  • 17
0
votes
0 answers

NSWorkspace launch and activate application despite activates property of OpenConfiguration set to false

As described in the title - NSWorkspace launch and activate application despite activates property of OpenConfiguration set to false. I want to launch Safari Extension Container (main application) as helper: func launchMainApp() { guard let…
Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
0
votes
0 answers

How to communicate between a SafariExtensionHandler and SafariExtensionViewController.xib

I'm writing a safari app extension using the default Xcode project and objective c. I want to add interface items to the popover(as Xcode has defined it with the SafariExtensionViewController.xib) and use the SafariExtensionHandler to control and…
Carl Carlson
  • 500
  • 4
  • 17
0
votes
0 answers

Apple's default Safari App Extension produces no results

I just installed the default safari app extension (the one created by Xcode) on my mac. Its icon is visible in Safari, but when I run the extension, nothing happens. Then when using the Safari/Developer/Web Inspector/ and choosing Sources, an…
Carl Carlson
  • 500
  • 4
  • 17
0
votes
0 answers

macOS Now Playing widget with next \ previous buttons

I‘m currently working on Safari App Extension whitch control the playback of media content on the website. Is there a way to have macOS Now Playing widget with next \ previous buttons with fully configured MediaSession handlers? So. What i mean.…
0
votes
0 answers

Get active tab from safari app in an extension?

Currently I'm working on safari app extension for iphones, and I want to get the maximum data from the safari app active page. I went through many posts but I couldn't find how to do? Could someone help please? [Extension folder][1] [1]:…
0
votes
0 answers

Prevent open multiply tabs (Safari App Extension)

I'm currently working on a Safari App Extension for specific site site (example.com for example) and configure toolbar item to show popover. But if safari have not tab with loaded site.com then this site must be loaded in new tab. Code in…
Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
0
votes
1 answer

How to detect when user Enable or Disable extension in Safari preferences

How to detect when user Enable or Disable extension in Safari preferences? I‘m interesting on to get notification immideatly when user Enable/Disable my extension.
Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
0
votes
0 answers

Why EventListener not fire in page context in Safari App Extension?

I'm trying to do something in the "page context", for this I inject the script in the page like this var pageScript = document.createElement('script'); pageScript.textContent = actualCode; document.body.insertBefore(pageScript,…
0
votes
1 answer

Why property of type SFSafariPage become nil?

The SFSafariPage property get it value like this class SafariExtensionHandler: SFSafariExtensionHandler { var somePage: SFSafariPage? override func messageReceived(withName messageName: String, from page: SFSafariPage, userInfo: [String : Any]?)…
Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
0
votes
1 answer

Safari App Extension: Toolbar popup JavaScript not running

I try to build a Safari App extension. The javaScript popup.js does not run for the toolbar icon. The popup.html is displayed correctly. popup.html
0
votes
1 answer

How to remove a blue tint in my SFSafariToolbarItem Image?

I'm building a Safari App Extension on MacOS. However my toolbar item in Safari is blue tinted. And whatever the PDF image I put in my project, the toolbar item does change the image, but the tint stays blue. Is there a way to put the initial gray…
nouatzi
  • 735
  • 4
  • 14
0
votes
1 answer

VoiceOver for macOS: how to set the initially focused element for a view controller?

How does one set the initially focused VoiceOver element after transitioning from one view controller to the next? I'm asking this as a macOS follow-up to this answer for iOS: VoiceOver: force an accessibility element to be selected after a screen…
0
votes
1 answer

Injected Javascript from Safari App Extension stops working once I make any modification

I'm trying to develop my first Safari App Extension and I followed Apple's document on building a safari app extension and my Xcode version is 11.5. It appears that the extension worked, as I can see the extension button loaded on Safari navigation…
CodeBrew
  • 6,457
  • 2
  • 43
  • 48