Change Displayed Text SizeGrow Displayed Text SizeShrink Displayed Text Size
 

Tuesday, February 04, 2003

Well, after some fiddling around I got the CocoaEmbed project to work in an "offline" mode, ie no network connections. So when viewing email, it won't load an image or whatever from a spammer's server. The key was to call CHBrowserView's stop method with the flag NSStopLoadNetwork immediately after I called the loadURI method. That should prevent anything from loading over the network, but I'd much prefer to have a flag set when the loadURI method is called. Hopefully nothing will slip in or screw up because i'm stopping it right after I tell it to load. Here's the code:
MyBrowserView.mm:
- (IBAction)load:(id)sender

{
NSString* str = [urlbar stringValue];
[browserView loadURI:str referrer:nil flags:NSLoadFlagsNone];
[browserView stop:NSStopLoadNetwork];
}

Just drop that in as the load method and you should have it working. So far I haven't been able to break it any more than the debug CHBrowserView is already broken-ish.

2/04/2003 10:11:00 PM ] [  0 comments  ]
[archives]
A good quick laugh