-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NSUserActivityTypeBrowsingWeb handling #3635
Add NSUserActivityTypeBrowsingWeb handling #3635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: ['pr-fix', 'pr-change', 'pr-feature', 'pr-maintenance']
@latenitefilms not sure how to add a a label afterwards, but I guess this is a |
I am out of town at the moment, but I will try and carve out some time here in the next couple of days to see about moving some of these forward. |
@asmagill any chance of getting this merged? |
Hammerspoon/MJAppDelegate.m
Outdated
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { | ||
[[NSWorkspace sharedWorkspace] openURL:userActivity.webpageURL]; | ||
} | ||
return YES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be unconditionally returning YES
? The docs suggest that we probably ought to return YES
only inside the if
statement, and otherwise return NO
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdbraber this is a fantastic update and would solve a major url handling complaint when using hammerspoon as the default browser. Thanks for tackling this! |
@mdbraber any updates or thoughts on this? |
@megalithic @mdbraber I made the change I think is correct and merged, it would be super helpful if someone could test the Development Build to check this is working. It should be available in an hour or so from: https://github.com/Hammerspoon/hammerspoon/actions/runs/10444554151 |
@cmsj thank you (also to @mdbraber); it works well! was able to handoff an ios brave browser tab to hammerspoon and the URL handlers for hammerspoon took over. 💯 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3635 +/- ##
==========================================
+ Coverage 27.61% 28.12% +0.50%
==========================================
Files 180 191 +11
Lines 36181 43532 +7351
==========================================
+ Hits 9993 12242 +2249
- Misses 26188 31290 +5102 |
Great to see this merged while I was away :-) |
To handle Handoff from a native app to a (default) browser
NSUserActivityTypeBrowsingWeb
needs to be handled. If a default browser supports this, Handoff links that have awebpageUrl
can be opened by the default browser.More info: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/Handoff/AdoptingHandoff/AdoptingHandoff.html