- Displaying archived web data in a WebView
[permalink]
WebArchive *archive = ... get from somewhere...;
WebFrame *frame = [webView mainFrame];
[frame loadArchive: webarchive];
- Opening webview links in the user's default browser.
[permalink]
...
[someWebView setPolicyDelegate: self];
...
- (void) webView:(WebView *)webView
decidePolicyForNavigationAction:(NSDictionary *)actionInformation
request:(NSURLRequest *)request
frame:(WebFrame *)frame
decisionListener:(id)listener {
NSURL *url = [request URL];
if (url != nil) {
[[NSWorkspace sharedWorkspace] openURL:url];
}
} // decidePolicyForNavigationAction
- Preventing Safari from displaying PDFs
[permalink]
I loathe using Safari to read PDFs. To tell Safari to stop it, try doing
% defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES
if you have the misfortune of having the Acrobat Reader plug-in, you can nuke /Library/Internet Plug-Ins/AdobePDFViewer.plugin