Cocoaアプリケーションに関連付けられたプロトコルハンドラーがあります。
[[NSAppleEventManager sharedAppleEventManager]
setEventHandler:self
andSelector:@selector(getUrl:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
..。
- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
#ifdef DEBUG
NSLog(@"%s: %@",__PRETTY_FUNCTION__,event);
#endif
NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
...
}
リファラーは誰ですか?(ローカルマシンから呼び出された場合は未定義になる可能性がありますが、Webサイトからこのプロトコルを呼び出した場合...リクエストの受信元のドメインを知りたいです。
それは可能ですか?
このタスクを別の方法で解決するための解決策はありますか?