|
|
Auto refresh unloaded Safari pages on AirPort link up
This is neat, I didn't know that.
Auto refresh unloaded Safari pages on AirPort link up
Yes, you can use SCNetworkReachability to register a callback.
I wrote a Python wrapper for it, which you can find in my LocationDo project (note that LocationDo is a general-purpose app at all, it does only exactly what I want, but you should be able to adapt it to do what you want). You can see how I use it in action.py:
class _LDURLWatcher(NSObject): def URLIsReachable_(self, notification): _openURL(notification.object()) _urlWatcher = _LDURLWatcher.alloc().init() NSNotificationCenter.defaultCenter().addObserver_selector_name_object_( _urlWatcher, 'URLIsReachable:', SCNetworkReachability.SCNetworkIsReachable, None) def openURL(url): hostname = NSURL.URLWithString_(url).host() if not SCNetworkReachability.notify_when_reachable(hostname, url): _openURL(url)That'll give you exactly Safari-like behavior—the URL opening will be postponed until the connection is up. I use it for exactly what you describe, opening the login pages. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.07 seconds |
|