The Safari app in visionOS has a navigation bar that detached from the main screen. Are there any examples of how to do this?
Thanks in advance.
Post
Replies
Boosts
Views
Activity
This is Version 13.0 Beta (22A5311f)
I see a crash in charts when I try to add more than one item to a Chart.
var body: some View {
Chart {
BarMark(
x: .value("Shape Type", data[0].type),
y: .value("Total Count", data[0].count)
)
BarMark(
x: .value("Shape Type", data[1].type),
y: .value("Total Count", data[1].count)
)
}
}
}
This doesn't crash with one item, which isn't a very useful chart. The crash is in the tuple code.
Charts17TupleChartContentVMn
_ Referenced from: /Users/eoinkortext/Library/Developer/Xcode/DerivedData/Chartest-cviqvlwnwkwzpncsusfuscqjflgt/Build/Products/Debug/Chartest.app/Contents/MacOS/Chartest_
I have logged this in FA already, just posting to see if it is well known, or I am on my own with this.
Hi all,
I want to create an application with SwiftUI that either
Quits when the last window is closed, or
Allows one window only. That is, the New Window command is greyed out when a window is already open. I don't hold much hope for this one, not in pure swiftUI, because the commands builder doesn't allow logic.
I am pretty sure this used to be a simple configuration on the Mac, this would be my best hope.
HI
Based on some of the examples here I have created an an app, for the Mac, with an DNS network extension. It looks in the app container code that everything seems to work. I had to play around with entitlements a bit. When I add the provider via the NEDNSProxyManager the first time. and save preferences the User is asked permission to install the Proxy and it duly appears in the network adapter list in system preferences. If I disable it is greyed out and there is no yellow dot.
However in the network panel I see that while the DNS Proxy is enabled it is not running, there is a yellow dot. It is enabled but not running.
I do write a lot of NSLogs in the NEDNSProxyProvider subclass but I don't see them appear in the console. When I try to attach to the process in Xcode using its bundleID it sticks in waiting for attachment. Is there a trick to debugging this?
This is, as I said, a Mac OS X app. Our iOS app seems to work with largely the same code.
I don't think it is an entitlement issue.
The documentation seems to indicate that the extension should restart on waiting i.e.
``
private func connectionStateChanged(to state: NWConnection.State) {
switch state {
case .waiting(let error):
os_log(.debug, log: self.log, "DNSProxyProvider Error opening connection -- waiting : (%{public}@)", error.localizedDescription)
connection.restart()
}
``
I sometimes find I get into a look when this happens
com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
2021-10-27 15:54:18.214239+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
2021-10-27 15:54:18.214696+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
2021-10-27 15:54:18.215288+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider Error opening connection -- waiting : (The operation couldn\U2019t be completed. (Network.NWError error 1.))
2021-10-27 15:54:18.215806+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider Error opening connection -- waiting : (The operation couldn\U2019t be completed. (Network.NWError error 1.))
2021-10-27 15:54:18.216271+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider Error opening connection -- waiting : (The operation couldn\U2019t be completed. (Network.NWError error 1.))
The network error here isn't very explanatory. My question is what to do here, if I get too many errors, should I cancel the connection or call flow.closeWithReadError, flow.closeWithWriteError
I have been working with a DNS proxy for a while now. It replaces for us the use of unbound as a DNS forwarding resolver. The application itself is a security app, something that logs. and potentially blocks, outgoing requests to websites or anywhere really, and shows a blocked page if the webpage violates a policy.
A policy can be set per user, or groups of users. If we block the News category for a user all categorised websites considered to be news are blocked. Uncategorised websites are flagged and categorised with a day or so. The policy can be changed per user, group, or everybody on a server and updates in a few minutes.
To this we re-reroute the DNS (along with some authentication and identifying EDNS data) to our own resolver and it will either return the block page or not. There are other issues with using the DNSProxy rather than Unbound that might make us abandon it anyway, at least until they are fixed*, but a big annoyance now is Safari's caching of DNS queries.
If there is a policy blocking news, and I load a news site on safari ( say sky news, and then start the proxy, the full site and links continues to work in Safari. Firefox and Chrome are blocked even if previously cached.
If I ping sky news I get the IP of our resolver. If I CURL the sky news page, and I see the block page html, and I can see that DNS proxy is working because I log the data for the outgoing datagram and it contains skynews.com. This is true of a ping or of a reload in safari. Except safari seems to ignore the ip that is returned in the DNS proxy.
I have tried a system wide cache removal i.e
. sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
but that also doesn't work.
Flushing the caches in safari doesn't work. (Develop -> Empty Caches). Erasing history doesn't work. A restart sometimes works but not always.
I know this isn't specifically about the DNS proxy but it seems to me that safari's over aggressive caching should be network extension aware. Is there any potential fix here?
we don't really want the user to be able to quit the proxy, or even have a choice of installing it. Of course people don't want to be tracked but our customers want to track them.
So I have implemented the NEDNSProxyManager in my application. This version of the application is replacing an older version which used unbound as a local server to redirect DNS. The application tries to monitor and block some pages when running. All is working ok so far.
However the addition of the network extension means that the user has to allow the extension in the privacy settings, and then accept that the DNS traffic is intercepted, and they can turn all this off in Network preferences in the interfaces sidebar. This bypasses our security. There are some workarounds I can put into the app but in the meantime I have a question.
I know the on iOS there is a requirement to install all of this via an MDM. Is that also possible and/or recommended on macOS. Would the MDM config file remove the necessity of the popups? Does it stop the removal of the
(By the way the user even as an admin seems to have a lot of freedom. It looks like I can delete the wifi interface without any password).
This is on a Mac. I am using MWPathMonitor to catch changes in the interfaces, I need to work out when a VPN is turned on. Certain VPNs, but not all, interfere with our project.
At the moment I create a MWPathMonitor and listen to changes via the NWPathMonitor.pathUpdateHandler callback.
That seems to work. When I turn on or off my VPN I get a new interface on the utun10. I test for utun*
My question is, is this reliable? Can there be more than one utun* interfaces even if VPN is not on?
Also what else should I look for to test for VPN, if any.