Post

Replies

Boosts

Views

Activity

Reply to Opening native app from a web extension
I think how you will open the containing app depends on your implementation and from where and how you are trying to do so. Using a custom URL scheme is the way I do it. I can open my containing app from a popup, content script, bundled html page or background by calling the window.open method like so: window.open("customURLscheme");
Topic: Safari & Web SubTopic: General Tags:
Jul ’21
Reply to Safari web extension - background script - sessionStorage
@nbe I never got notified you replied. I am able to set, get and remove session and local storage from my background page/script without issue. I am not using the safari converter however, so perhaps it's an issue with that or how you are going about setting/getting. That being said the person who replied has good advice, I'd do what he says.
Topic: Safari & Web SubTopic: General Tags:
Sep ’21
Reply to SFErrorDomain Code=3 "(null)"
To add some additional clarity, the message that is failing returns an array of of dictionaries [[String: Any]]. It seems that when the array length is greater than 6 the error occurs, however if the array is less than 6 it does not occur.
Topic: Safari & Web SubTopic: General Tags:
Oct ’21
Reply to Using Google Analytics w/Safari Extension
@DSNET to be honest, I don't remember what I ended up doing. I don't use any analytics in my recent extensions, but you can see the source code for the extension I was working on when I made this question here: https://github.com/quoid/coin-ticker - Keep in mind this was the old Safari JS api (hence the 3 year old question)
Topic: Safari & Web SubTopic: General Tags:
Oct ’21
Reply to iOS Safari Extension Memory Limit 6MB
If you're like me and your extension is randomly breaking and you suspect a memory issue, here's what the console message looks like. Be aware it's not a fault or error in the console, this caused me to miss it initially. Side note, I still have no idea how to monitor memory usage in mobile safari whilst developing.
Topic: Safari & Web SubTopic: General Tags:
Oct ’21
Reply to Can a Safari extension detect a page navigation error?
What API would you use to build this? A solution for this off the top of my head, whilst using the WebExtension API goes something like this. JavaScript files of extensions are not loaded for that error page either.  That's right. Content scripts are not loaded in that kind of error page. The background page is loaded however. You could try to listen for browser.webNavigation.onCompleted and then check the currently active tab: browser.tabs.query({currentWindow: true, active: true}, tabs => { const active = tabs[0]; // do something with the tab data }); You could read the active.title and derive if the page failed to load or even run your own fetch and get the status code back and decide what to do from there. I haven't tested this so I can't confirm whether or not browser.webNavigation.onCompleted actually fires for those kind of error pages, but worth a try if you're invested in this.
Topic: Safari & Web SubTopic: General Tags:
Oct ’21
Reply to declarativeNetRequest - redirect action type not supported
There are other ways to accomplish a redirect within the extension, but none will likely have as good UX by doing it the way you described. Building out the declarativeNetRequest api in Safari would be really beneficial to developers and I am sure filing feedback would help get that point across. browser.webRequest could be used, however it is only supported for persistent background pages, which is incompatible with iOS and manifest v3 project. - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest You could use a content script to redirect, however depending on the amount of logic in your app, this could be less optimal UX. You could use browser.tabs.update, but again, less than optimal user experience: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/update Hopefully Apple will build out the rest of this API for Safari. Here's a somewhat related thread: https://developer.apple.com/forums/thread/682541
Topic: App & System Services SubTopic: General Tags:
Feb ’22
Reply to Opening native app from a web extension
I think how you will open the containing app depends on your implementation and from where and how you are trying to do so. Using a custom URL scheme is the way I do it. I can open my containing app from a popup, content script, bundled html page or background by calling the window.open method like so: window.open("customURLscheme");
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Safari web extension - background script - sessionStorage
Where are you trying to store session data? You mentioned your background script, but it is unclear if you are trying to set session data for the background page, popup, extension page or on a webpage via content script.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Safari web extension - background script - sessionStorage
@nbe I never got notified you replied. I am able to set, get and remove session and local storage from my background page/script without issue. I am not using the safari converter however, so perhaps it's an issue with that or how you are going about setting/getting. That being said the person who replied has good advice, I'd do what he says.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Add iOS Support for Existing Safari WebExtension
Xcode 13 was required
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to SFErrorDomain Code=3 "(null)"
To add some additional clarity, the message that is failing returns an array of of dictionaries [[String: Any]]. It seems that when the array length is greater than 6 the error occurs, however if the array is less than 6 it does not occur.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to iOS Safari Extension Memory Limit 6MB
How do we monitor memory usage of an iOS Safari Web Extension? Does the iOS app memory usage indicate what the Safari Web Extension is using in iOS?
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Using Google Analytics w/Safari Extension
@DSNET to be honest, I don't remember what I ended up doing. I don't use any analytics in my recent extensions, but you can see the source code for the extension I was working on when I made this question here: https://github.com/quoid/coin-ticker - Keep in mind this was the old Safari JS api (hence the 3 year old question)
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to iOS Safari Extension Memory Limit 6MB
If you're like me and your extension is randomly breaking and you suspect a memory issue, here's what the console message looks like. Be aware it's not a fault or error in the console, this caused me to miss it initially. Side note, I still have no idea how to monitor memory usage in mobile safari whilst developing.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to SFErrorDomain Code=3 "(null)"
This was throwing an error because I was hitting the 6mb memory limit. Example of console error posted here: https://developer.apple.com/forums/thread/687642?answerId=691678022#691678022
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Can a Safari extension detect a page navigation error?
What API would you use to build this? A solution for this off the top of my head, whilst using the WebExtension API goes something like this. JavaScript files of extensions are not loaded for that error page either.  That's right. Content scripts are not loaded in that kind of error page. The background page is loaded however. You could try to listen for browser.webNavigation.onCompleted and then check the currently active tab: browser.tabs.query({currentWindow: true, active: true}, tabs => { const active = tabs[0]; // do something with the tab data }); You could read the active.title and derive if the page failed to load or even run your own fetch and get the status code back and decide what to do from there. I haven't tested this so I can't confirm whether or not browser.webNavigation.onCompleted actually fires for those kind of error pages, but worth a try if you're invested in this.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Unable to authenticate with App Store connect
Restarting XCode and my computer did not resolve it. However, doing the following did: I removed and re-added the account that owned the signing certificate in the XCode -> Preferences -> Accounts menu. You can remove the account by highlighting it and then hitting the minus (-) button, and re-add it using the + button.
Replies
Boosts
Views
Activity
Nov ’21
Reply to Is webRequest supported?
browser.webRequest is not available when the background is persistent: false, that is why I could not access it
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Safari Web Extension tab ids are 0 during webNavigation callbacks until onCompleted event
Can we get more info on this? Not having access to the actual tabId limits extension potential for pre-processing before the load events. This is still the case with Safari 15.2
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Distribution of safari web extensions outside of the store
Here's a forum post with a reply for an Apple employee: https://developer.apple.com/forums/thread/659029 In my experience, the user has to click "Allow Unsigned Extensions" every time they open Safari. Also in my experience, distributing web extensions this way is far from optimal.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to declarativeNetRequest - redirect action type not supported
There are other ways to accomplish a redirect within the extension, but none will likely have as good UX by doing it the way you described. Building out the declarativeNetRequest api in Safari would be really beneficial to developers and I am sure filing feedback would help get that point across. browser.webRequest could be used, however it is only supported for persistent background pages, which is incompatible with iOS and manifest v3 project. - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest You could use a content script to redirect, however depending on the amount of logic in your app, this could be less optimal UX. You could use browser.tabs.update, but again, less than optimal user experience: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/update Hopefully Apple will build out the rest of this API for Safari. Here's a somewhat related thread: https://developer.apple.com/forums/thread/682541
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’22