Re: Any way to intercept the URL-opening mechanism on OS X?

2016-01-03 Thread Uli Kusterer
On 03 Jan 2016, at 00:04, Conrad Shultz wrote: >> On Dec 22, 2015, at 3:51 PM, Rick Mann wrote: >> >> You know how you can click links in email, and heck, to open them in Safari >> (or whatever browser)? Is there any way to write an extension of

Re: Any way to intercept the URL-opening mechanism on OS X?

2016-01-02 Thread Conrad Shultz
You should be able to listen, at the application level, for a beforeNavigate event and then effectively modify the URL by canceling the navigation with preventDefault() and triggering a new load using your rewritten URL. See also

Re: Any way to intercept the URL-opening mechanism on OS X?

2016-01-02 Thread Rick Mann
Hmm I'll try that. > On Jan 2, 2016, at 15:46 , Conrad Shultz wrote: > > You should be able to listen, at the application level, for a beforeNavigate > event and then effectively modify the URL by canceling the navigation with > preventDefault() and triggering a new

Re: Any way to intercept the URL-opening mechanism on OS X?

2016-01-02 Thread Conrad Shultz
> On Dec 22, 2015, at 3:51 PM, Rick Mann wrote: > > You know how you can click links in email, and heck, to open them in Safari > (or whatever browser)? Is there any way to write an extension of some sort > that can intercept this and re-write the URL? I tried to write

Re: Any way to intercept the URL-opening mechanism on OS X?

2016-01-02 Thread Rick Mann
That was my first attempt, and it provides no way to modify the main url. Sent from my iPhone > On Jan 2, 2016, at 15:04, Conrad Shultz wrote: > > >> On Dec 22, 2015, at 3:51 PM, Rick Mann wrote: >> >> You know how you can click links in

Re: Any way to intercept the URL-opening mechanism on OS X?

2015-12-23 Thread Jens Alfke
> On Dec 23, 2015, at 12:36 AM, Rick Mann wrote: > > Hmm, didn't this change in iOS 9 and 10.11 to only work per-app? NSURLProtocol has _always_ been per-app. It’s not a system extension, it’s a way of hooking into NSURLConnection / NSURLSession in the current process.

Re: Any way to intercept the URL-opening mechanism on OS X?

2015-12-23 Thread diederik
Can't NSURLProtocol help you here?? Docs: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLProtocol_Class/ Tutorial: http://www.raywenderlich.com/59982/nsurlprotocol-tutorial > You know how you can click links in email, and heck, to open them in >

Re: Any way to intercept the URL-opening mechanism on OS X?

2015-12-23 Thread Rick Mann
Hmm, didn't this change in iOS 9 and 10.11 to only work per-app? > On Dec 23, 2015, at 00:32 , diede...@tenhorses.com wrote: > > Can't NSURLProtocol help you here?? > > Docs: > https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLProtocol_Class/ > >

Any way to intercept the URL-opening mechanism on OS X?

2015-12-22 Thread Rick Mann
You know how you can click links in email, and heck, to open them in Safari (or whatever browser)? Is there any way to write an extension of some sort that can intercept this and re-write the URL? I tried to write a filter in Safari proper for the URL that the user pastes into the address bar,