Safari Extensions

RSS for tag

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

Posts under Safari Extensions tag

101 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Safari DNR API timing issues
I created a Xcode project to test the DNR updateDynamicRules API performances on Safari (MacOS). https://github.com/radiolondra/TestUpdateDynamicRules Following the instructions in the README file, it's possible to test the extension on Chromium and Firefox browsers (on Windows). The project uses 2 json files containing static rules, enabled by default in the manifest file. These static rules are automatically installed in the browser when the extension is installed. Using the extension popup it is possible to add/remove just one very simple dynamic rule in the browser, a rule that acts on a predefined test domain (https://iana.org). What we want to measure is the time it takes for each browser to add/remove that one dynamic rule. The results for Safari are unacceptable to say the least: Safari: from 6000 to 8000 MILLISECONDS (6/8 seconds!) <<<<<<<<< Chrome: from 5 to 6 MILLISECONDS Firefox: from 5 to 7 MILLISECONDS Notice the time needed by Safari... It would be a good idea to take a look at this monstrosity. Thanks.
4
0
113
1d
Safari History Delete ISSUE
My Safari Web Extension uses a service worker and an IndexedDB database (IDB). For what hidden reason or perverse logic when deleting the Safari history all service workers are brutally shutted down and the database emptied of all its contents? And I heard about local storage too... It happens all the time in Safari macOS and iOS. Safari is the only browser in the world that takes the liberty of deleting what it shouldn't. Good Job indeed.
0
0
89
1d
Browser.permissions.request not working as expected
Hi there - I am trying to port over Chrome extension over to Safari Web extension. Looks like Safari has a very aggressive permissions flow which isn't a great user experience but I get the privacy benefits. I am trying to move some of my permissions like <all_urls> or tabs as optional permissions and build a flow where I can request the user for them in hopes that i can educate them as to why I need them similar to how Chrome/FF have it. However when i use browser.permissions.request - i always end up getting true without invoking the prompt. The prompt seems to come up regardless when i start visiting a website. Can someone help with this? Sounds more like a defect in Safari.
2
0
1k
5d
NO EXTENSIONS INSTALLED on Settings > Safari > Extensions
I'm developing an extension on Xcode, trying to test on my iPhone 7 plus. When I connect my iPhone with my Mac that Xcode is running on, and click Run, the app shows up on my iPhone. But when I check Settings > Safari > Extensions, it says "NO EXTENSIONS INSTALLED. Extensions customize the way Safari works. Extensions can change the appearance or behavior of web content, add buttons to Safari, and more." I'm using : Xcode : Version 14.0.1 Mac OS monterey : Version 12.7.5 iPhone 7 plus : Version 15.8.2
1
0
112
1w
It's not possible to open a link in a new tab on a page with the "safari-web-extension://someurl..." protocol
I have an extension that opens the start page after installation with the URL: safari-web-extension://my-web-extension-page.html It's not possible on this page to open any link on a new tab if the link has attribute target="_blank" or even with "Command (⌘) + click" combination Are there any restrictions on pages with protocol safari-web-extension://?
2
1
501
1w
spacial computing
Hello, I've test Apple spacial computing since few weeks now. I've hope working on spacial computer will give me more productive. At this time, safari extensions I use (bitwarden) was not available. There is no other web browser available. I've not find how to use xcode in my spacial computer. I've not find any native (not iPad) terminal tool. Mac screen sharing only give me one screen (and I've got 4 in my desk). This screen can be very big but I prefer having 4 little screen better a big one. And screen sharing is not usable using mouse at all. my mouse always disapear from my screen when sharing with my spacial computer. For all theses case, using spacial computing for working is not realist at this time in my specific case. I lost to many time using it instead of using a "real" computer. Hope this message can help you to upgrade software and give me all tools needed to use it to work. Best regards, Julien Boquet
0
0
132
1w
iOS 17.4.1 Safari extension issues
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
13
3
1.5k
1w
Safari Web Extension and Sign in with Apple
My existing chrome extension has "Sign in with Apple" given that we have iOS users. When user clicks "Continue with Apple" button in the extension log in pop up, this is what we do: javascript window.open( 'https://appleid.apple.com/auth/authorize?client_id=' + clientID + '&amp;redirect_uri=' + backEndURL + '&amp;response_type=id_token%20code&amp;response_mode=form_post&amp;scope=email%20name', 'Sign in with Apple', 'height=500,width=400,left=600,top=200,status=no,location=no,toolbar=no,menubar=no' ) In chrome, this opens a popup window with that URL. In Safari Converted Web Extension, it opens custom Apple sign in flow, where it says: "Do you want to sign in to *** with your Apple ID YYY?" and then with my mac password I'm able to authenticate. Afterwards, nothing happens. Expected: a redirect to the URL specified in the window.open. Now let's do a trick: I'll wrap the above window.open code into javascript setTimeout (() = {window.open (...)}, 3000) Because of security reasons, safari then won't open the popup after 3s and will display a notification in the toolbar "Popup blocked..". If we allow the popup, then it finally opens as a normal window popup and after sign in, it redirects to our backend and it successfully authenticates. Any ides what how to solve this? P.S. We're not able to use embedded Sign in with Apple JS - https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple script because we can't host a remote code in the extension (it will be deprecated soon). So, we arere using this. - https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms
2
0
1.5k
2w
Content script sometimes does not load
Steps to reproduce the problem: Have an extension which has a content_scripts section in its manifest that specifies a content script for some URLs. Open a tab at a URL that the extension should inject a content script in. What is the expected behaviour? The content script should execute on the page, and if you open the Developer Tools and go to the Console tab, then the extension should be listed inside of the "Extension Scripts" dropdown (the dropdown immediately to the right of the "Clear console" button). What went wrong? After prolonged inactivity, sometimes the content script doesn't show up in the Extension Scripts dropdown (which it would if it were executing). There's no evidence in the page's Developer Tools that the extension is active. It doesn't execute at all, there's no messages in the console related to it or its non-execution, and its content scripts don't show up in the Sources tab of Developer Tools. When the issue happens, the extension still shows up in the browser toolbar as an option.. The extension's icon shows up and functions normally. The extension background page is inspectable and seems to be running normally. Refreshing the webpage doesn't fix it. But once we open the ios App it starts working again. Safari version: 74 OS Version: OS X 10.14.5
1
0
209
2w
For a Mac Safari web extension, how to actually implement IAP?
I want to implement in-app purchases for my Mac Safari web extension. I can think of two ways: Draw the payment UI in an extension web page, and send a message to the native extension app to call StoreKit code. Open the container app from an extension web page, where the app draws the payment UI. I couldn't make #1 work with either StoreKit 2, which is async, and context.completeRequest(returningItems:) doesn't want to be called in a Task, saying context is not sendable) or StoreKit 1, where calling context.completeRequest(returningItems:) in paymentQueue(_:updatedTransactions:) for some reason doesn't return a response to the extension's web page. I couldn't make #2 work because I couldn't find a way to open the container app from the web extension. I registered a custom URL for my container app, but context.open that url does nothing. Web extensions that use IAP with #2 are available on the Mac app store, so it must be possible, could anyone shed some light on how to open the container app and pass the purchased info to the extension web page even if the container app is not open? Thanks in advance.
0
0
131
3w
iOS 17.4: Safari Extensions broken?
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.
0
0
359
Apr ’24
Safari Web Extension update asks to restart Safari.
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?
0
0
268
Apr ’24
TestFlight is installing the incorrect version and build of the application.
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?
1
0
310
Mar ’24
Team Error encountered while publishing the Safari extension via Xcode
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
0
0
323
Mar ’24
Do iOS Safari ServiceWorkers get shut down due to thermal state?
Hi! I'm working on an iOS Safari extension that has a ServiceWorker. Lately we've noticed that this ServiceWorker seems to get killed seemingly at random, and there are no logs or crash reports to tell us what happened. I'm hypothesizing that iOS might be shutting down Safari ServiceWorkers when the ProcessInfo.thermalState approaches .serious. I have circumstantial evidence that our ServiceWorker tends to get killed more often at higher levels of thermalState but can't yet say conclusively that this is the case. I can't find any direct evidence of this on internet searches either. Is anyone able to shed light onto this topic? The specific symptoms are: ServiceWorker stops, and the menu entry for its console window no longer appears on macOS Safari. No crash logs via Xcode or Sentry, and no Console messages as far as we could tell (caveat: MobileSafari generates a LOT of messages! We might have missed it.) If attached via debugger, the native part of our extension just disappears and the debugger loses connection with no error message. ServiceWorker no longer works for the lifetime of the Safari process. Sometimes, when we kill Safari and restart, we can get the ServiceWorker back. This usually requires toggling our extension's "enabled" state in system settings. In some cases, even killing/relaunching Safari and toggling the system setting doesn't bring our ServiceWorker back. I'm hypothesizing right now that this happens when the thermal state is high. I've tried simulating a serious/critical thermal state in the Xcode Devices window, but couldn't repro the ServiceWorker problem. I don't know if that setting affects the whole system, though, or just our own apps. Help appreciated! Yuna
7
0
2.1k
Mar ’24