Safari Extensions

RSS for tag

Enhance and customize the web browsing experience on Mac, iPhone, and iPad with Safari Extensions

Safari Extensions Documentation

Posts under Safari Extensions tag

112 Posts
Sort by:
Post not yet marked as solved
0 Replies
80 Views
We’ve received a lot of user complains after the latest iOS 17.4 update. Our Safari extension does not work as reliably as it used to be (sometimes it’s just not loaded, or very slowly). Is this a known issue? Are any workarounds available? On iOS 17.5 the problem seems to be fixed, but I’m still wondering for a workaround because we dont know how long until 17.5 is released.
Posted
by
Post not yet marked as solved
5 Replies
278 Views
Since updating to iOS v17.4.1 our safari extension no longer functions as it used to We are experiencing issues where our content script is not getting initialized, On devices running iOS 17.4.1, the content script included in our extension does not appear to run. There are no logs from the content script in the console, whereas on other versions and devices, it operates as expected. Our Extension relies con communication between the background and content scripts in order for us to render various popups to our users, based on our logs as of iOS 17.4.1 this communication is not successful, we can see messages being sent from the background script but as mentioned above nothing on the content script side. This behavior happens majority of the time and on random sites, sometimes opening the same site in a new tab would work but not always. There are also times where we would only receive our popups after opening the safari menu and interacting with our extension via this menu. Please assist with a way forward
Post not yet marked as solved
0 Replies
140 Views
We have an app with a web extension for Safari. We developed this app for a couple of years. Recently when we pushed an update to TestFlight or the Mac App Store, the user that updated the app, there's the dialog from macOS that asks to : Close Safari to continue the update. Click on continue to quit "safari" … It seems a recent change. Is there a way to prevent quitting Safari when we push to update to TestFlight and Mac App Store?
Posted
by
Post not yet marked as solved
1 Replies
183 Views
I'm trying to develop a Safari app extension and want to enable a persistent background page for it. I could find examples of how to enable it for Web extensions using manifest.json, but for App Extension it seems that I need to use Info.plist and I couldn't find any documentation on it. How can I use the background page?
Posted
by
Post not yet marked as solved
1 Replies
216 Views
I have created a new build for my Safari web extension and distrbuted it to test flight. Test Flight says I am using the correct version - but when I go to the Setting > Extensions in Safari and enable it - it still has the old version number. App Store showing the correct version is in testing Test Flight confirming said version number Safari with the incorrect version Any idea what I am doing wrong?
Posted
by
Post not yet marked as solved
0 Replies
222 Views
I've created a Safari extension using Xcode, and it works fine on my local system. However, when I try to deploy the extension, I encounter an error message stating "No team found in archive." I've already added the team while setting up the extension. Could someone please assist me in identifying what I might be doing incorrectly? Below are screenshots showing my configuration and the error message I'm encountering during deployment. Following are the configuration screeshots Following is the error screeshot
Posted
by
Post not yet marked as solved
0 Replies
174 Views
Hi, I converted a chrome extension to safari extension and in order to pass review I have to have a thorough description in the safari extension pane (which is within safari when you configure/setup the extension) Do anybody know where I can change this description in xcode? Tyler
Posted
by
Post not yet marked as solved
0 Replies
177 Views
I want to develop a safari extension for a study for a pet project website. I want to understand the challenges faced by the users while making searches on my e-commerce website. So the extension would basically trigger a survey when active on my website. If I were to understand what was searched on the website I would need to capture the url for the current page on they are on. Would this be possible? Would it comply with Apple regulation policies?
Posted
by
Post not yet marked as solved
1 Replies
254 Views
My Safari App Extension is having trouble with one website. This is typical for some other websites as well. Navigating to that website results in 6 “Load” events. For each such event I send a “safari.extension.dispatchMessage” to my objC code. For the first of these Load messages, my objC code sends a ‘sendMeIcons” message to “safari.self.addEventListener('message', function(event)”. The other 5 Load events are ignored by my objC code and do not send this message. safari.self.addEventListener('message', function(event) receives sendMeIcons JUST once. Yet, the event handler for this message) is invoked 4 times. The first invocation is correct. The other 3 are spurious. I have no idea why this is happening. Here is my objC code safari.self.addEventListener('message', function(event) { if (event.name === "Load My URL") { console.log('In event listener Load My URL'); ... return; } if (event.name === "sendMeIcons") { ... if (hrefs.length <1) //THIS IS ALWAYS TRUE FOR THIS TEST CASE. { safari.extension.dispatchMessage("js Found No Icons"); return; } else { ... safari.extension.dispatchMessage("IconsReturned",{"urls": arrayOfUrls}); return; } } I don't have a clue how to proceed. Any suggestions.
Posted
by
Post not yet marked as solved
0 Replies
251 Views
Can someone share how secure is the communication between iOS app and its safari mobile extension. Is it encrypted? Are there any references to best practices to follow? If a user has opened multiple tabs and has multiple extensions can there be security issues during their communication like one extension able to read other extensions memory?
Posted
by
Post not yet marked as solved
0 Replies
250 Views
The SFSafariViewController documentation mentions not to display content from websites when using the pageSheet and formSheet presentation styles for the In-App browser. Is this a hard restriction that is enforced or more of a loose guideline? And if possible, providing the reasoning behind it would be great. Thanks in advance.
Posted
by
Post not yet marked as solved
0 Replies
230 Views
Is there any way to configure SFSafariApplication.dispatchMessage to send a message to the web extension from a specific profile? According to the documentation , using SFExtensionProfileKey, the native app can determine the profile that sent a message. Can SFSafariApplication.dispatchMessage send a message to a specific profile? The default behavior seems to be to send the message to all profiles.
Posted
by
Post not yet marked as solved
0 Replies
238 Views
Hey, I am developing Safari Web Extension and trying to communicate with the swift handler (SafariWebExtensionHandler) using runtime.sendNativeMessage api (as describe here - https://developer.apple.com/documentation/safariservices/safari_web_extensions/messaging_between_the_app_and_javascript_in_a_safari_web_extension). I'm getting the following error when calling it - calling runtime.sendNativeMessage(): Error Domain=NSCocoaErrorDomain Code=4099 "Couldn’t communicate with a helper application." I have no Idea what is missing and couldn't find any meaningful error message anywhere. I do have nativeMessaging permission in my manifest.json. Assist will be appreciated.
Posted
by
Post not yet marked as solved
1 Replies
372 Views
I recently noticed that using Google Docs, Google Sheets, and any other Google-related sites on a Safari browser uses tons of RAM. It usually consumes around 4-5 GB of RAM. Compare it to when I use Google Docs on Chrome; it only uses around 1-2 GB. Why is this so? I want to use Safari alone for work, but it's so slow. Do you have any tips on this?
Posted
by
Post not yet marked as solved
1 Replies
266 Views
Hello, Is it possible to take a screenshot of a non-active tab? Firefox supports this via captureTab (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/captureTab) With Safari App extensions that was possible via getScreenshotOfVisibleArea which doesn't seem to work with Safari extensions.
Posted
by
Post not yet marked as solved
1 Replies
316 Views
We're seeing a delay of between 50mS to 150mS when just sending a short "ping-pong" message between 'inject.js -> extension code (swift) -> inject.js' what might be wrong? are there any ways to get a more reasonable IPC communication channel between the javascript and swift side. I would like to achive <= 1mS delay roundtrip.
Posted
by
Post not yet marked as solved
0 Replies
266 Views
I've successfully built a Safari extension for my app, but I've noticed that some applications have a slightly different style when opening the native modal through the "aA" button (I'm not referring to the injected cloned modal, but the "native" one). There are two major differences I observed: the first is the header color, which is gray instead of the regular white, and the second is that this modal doesn't open in full screen when dragged to the top, unlike the regular one. I'm interested in knowing how they achieved this. I couldn’t find any information about it anywhere on the web/docs. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
291 Views
Hi, We provide a Safari App Extension to our customers. It follows the standard Safari Extension App layout - the Extension is inside the App, the App takes care of installing the Extension in Safari. The Extension requires the Input Monitoring and Screen Recording permissions to be granted from the user. At some point during its execution, the Extension runs the code that triggers the TCC permission prompt. When the user goes to Security & Privacy Preferences dialog and clicks on the checkbox next to the Extension entry to grant the permission, the checkbox remains unchecked, however, the permissions are actually granted. This is the issue, and it is confusing for the user. Moreover, if the user decides not to grant the permissions (closes the initial prompt by clicking on the 'Deny' button) s/he will be prompted again when the Extension runs the next time (and every time). The App that contains the Extension does not suffer the same problem. Its entry in Security & Privacy Preferences responds correctly to checking/unchecking the checkbox. Unfortunately, the permissions granted to the app do not apply to the Extension contained within. Querying the main TCC database (/Library/Application Support/com.apple.TCC/TCC.db) shows one kTCCServiceListenEvent entry for the app, identified by its BundleID (permissions granted). For the Extension there are two entries - one identified by the the BundleID (permissions granted) and the other identified by the path to the Extension (permissions not granted). kTCCServiceListenEvent|/Volumes/Common/Sandboxes/Monterey/AppExtPermissons/DerivedData/AppExtPermissons/Build/Products/Debug/AppExtPermissons.app/Contents/PlugIns/AppExtPermissons Extension.appex|1|0 kTCCServiceListenEvent|com.gemalto.AppExtPermissons|0|2 kTCCServiceListenEvent|com.gemalto.AppExtPermissons.Extension|0|2 The system logs show some tccd-related errors when trying to check the checkbox: Console logs when trying to grant permissions We suspect this might be the reason why the checkbox next to the Extension entry under Input Monitoring in Security & Privacy does not respond to clicks. The same problem applies to granting Screen Recording permissions to the Extension. I constructed a minimal example based on the default Safari App Extension project - basically only added code that would trigger the permission granting prompt in the App and the Extension. Can provide a link to a zip if deemed useful. Are we doing something wrong, maybe missing an ID or a plist string somewhere?
Posted
by