Posts

Post not yet marked as solved
15 Replies
0 Views
I'm also facing the same issue so I've sent Apple my feedback on Feedback Assistant as FB10748429. The more feedback, The more they care about this issue. Unfortunately, Just posting "same" or "any news?" in the developer forums never changes Apple's priority. The only way to change it is to submit feedback on Feedback Assistant. As far as I can see, only dcordero sent feedback on this thread but it's not enough. I need your help. Please submit your own feedback and let's change Apple's mind.
Post not yet marked as solved
2 Replies
0 Views
I've just chatted with an Apple developer (Timothy Hatcher) in the WWDC's lab. According to him, this has already been fixed internally and will be deployed soon. So this issue will be solved once your users update the Safari version to (hopefully) 15.6 or later, since the current version is 15.5. Thanks, Timothy. 🙂
Post marked as solved
3 Replies
0 Views
@DSNET If you want to change the displayed extension name on Safari's Preferences window, changing CFBundleDisplayName (not CBBundleDisplayName) should work for Safari extensions too, but you need to reopen Safari to reflect it.
Post not yet marked as solved
1 Replies
0 Views
Apple recommends checking built-in en0, built-in en1, and non built-in en0 in that order. This is the details: https://developer.apple.com/documentation/appstorereceipts/validating_receipts_on_the_device
Post not yet marked as solved
2 Replies
0 Views
You should use fill(). RoundedRectangle(cornerRadius: 8, style: .continuous)     .fill(Color(red: 255, green: 245, blue: 158)) Don't use background() for changing the color of RoundedRectangle. It just fills the background of the rounded rectangle rather than the rounded rectangle itself.
Post marked as solved
3 Replies
0 Views
Sorry, I mean, like this. swift scrollView.contentView.automaticallyAdjustsContentInsets = false scrollView.contentView.contentInsets = .init(top: 20, left: 0, bottom: 0, right: 0)
Post marked as solved
3 Replies
0 Views
Setting the scroll view's automaticallyAdjustsContentInsets property to false solved my problem. In my case, I needed to set it to scrollView.contentView rather than the scroll view itself, like this: swift scrollView.automaticallyAdjustsContentInsets = false scrollView.contentInsets = .init(top: 20, left: 0, bottom: 0, right: 0)
Post not yet marked as solved
3 Replies
0 Views
I'm now developing a Safari extension that redirects web pages, then I got here. As timothy.hatcher said, it's shame that there is no perfect solution so far. Any workarounds I tried has some problems that they send a network request for the source URL or they are unstable. So I gave up and I just use window.location.href for now. FWIW, the code I wrote is below. By the way, I submitted a feedback as he suggested. I hope many other people will also submit it. Code Swift class SafariExtensionHandler: SFSafariExtensionHandler {     override func messageReceived(withName messageName: String, from page: SFSafariPage, userInfo: [String : Any]? = nil) {         page.getPropertiesWithCompletionHandler { [weak self] properties in             guard let self = self else {                 return             }             switch messageName {             case "pageLoaded":                 guard let url = properties?.url else {                     break                 }                 self.redirectIfNeeded(currentPage: page, url: url)             default:                 break             }         }     }     override func page(_ page: SFSafariPage, willNavigateTo url: URL?) {         guard let url = url else {             return         }         redirectIfNeeded(currentPage: page, url: url)     }     private func redirectIfNeeded(currentPage: SFSafariPage, url: URL) { &#9;&#9;&#9;&#9;let redirectIsNeeded = <#put your condition here#> &#9;&#9;&#9;&#9;guard redirectIsNeeded else { &#9;&#9;&#9;&#9;&#9;&#9;return &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;// You may need to delay this code with `DispatchQueue.main.asyncAfter(deadline:)` or something like that &#9;&#9;&#9;&#9;// because this can't redirect a web page that has the `Location` response header. &#9;&#9;&#9;&#9;currentPage.redirect(to: url)     } } private extension SFSafariPage {     func redirect(to url: URL) {         dispatchMessageToScript(             withName: "redirectPage",             userInfo: ["url": url.absoluteString])     } } Javascript (function () {     if (window.top === window) {         safari.self.addEventListener(             'message',             (event) => {                 if (document.hidden) {                     return;                 }                 switch (event.name) {                     case 'redirectPage':                         window.location.href = event.message.url;                         break;                 }             },             false);         safari.extension.dispatchMessage('pageLoaded');     } })();