iOS: UIWebView full open source browser?
Solution 1
SVWebViewController looks pretty much like what you're looking for.
Solution 2
I have started an open source project (MIT License) to make something as close as possible to the native MobileSafari application (on iPhone and iPad).
Here are the features so far :
- Design close to Mobile Safari (iOS 4.x) native application (for both iPhone and iPad)
- Bookmark support (support for folders in bookmarks not implemented yet)
- Mail link support
- Print web page support
- Long tap handling (open or copy link) with customizable menu
Anyone wanting to contribute to this project is welcome to do it !
You can clone/fork the project here : https://github.com/sylverb/CIALBrowser
Solution 3
https://github.com/ghostery/banshee
EDIT the project is now maintained here: https://github.com/acatighera/banshee
It's an open source browser with tabs, bookmarks, search, etc.
Solution 4
UIWebView
is a full browser ! To open a url in webView
you do this -
NSURL *url = [NSURL URLWithString:webAddress];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[webView loadRequest:req];
You can even insert javascript into UIWebView
. You could customize it to your liking.
//To customize the look & feel...
self.webView.scalesPageToFit = YES;
self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.webView.autoresizesSubviews = YES;
//To insert Javascript
NSString *jsCommand = [NSString stringWithFormat:@"document.body.style.zoom = 0.5;"];
[self.webView stringByEvaluatingJavaScriptFromString:jsCommand];
You could do lot more. Have fun...
UPDATE: To get a back button and all, webView
provides those features, back, forward etc. all those browser features. You need to code up the buttons & UI & for code you could do this -
-(IBAction)goForward:(id)sender
{
[webView goForward];
}
-(IBAction)goBack:(id)sender
{
[webView goBack];
}
-(IBAction) gotoHome:(id)sender
{
NSString *urlAddress = @"http://google.com";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
}
Solution 5
You can also check out KINWebBrowser, a drop in web browser module for your apps. https://github.com/dfmuir/KINWebBrowser
Features
- iOS 7 & 8 support for iPhone and iPad
- Customizable UI
- Portrait and landscape orientation support
- Use with existing UINavigationController or present modally
- Load URL from NSURL or NSString
- Delegate protocol for status callbacks
- Action button to allow users to copy URL, share, or open in Safari & Google Chrome
- Supports subclassing
- Installation with CocoaPods
Nic Hubbard
Updated on June 04, 2022Comments
-
Nic Hubbard almost 2 years
Does anyone know if there are any open source solutions out there that use UIWebview to build a full browser? There is something like this in Three20 when you pass a URL, but I am assuming there must be other alternatives out there.
I realize that UIWebView is a web browser, but hooking up refresh, back button, URL bar, etc will take extra time.
Suggestions?
-
Nic Hubbard over 12 yearsI realize that. Looking for something built with back button, URL bar, refresh etc. already built.
-
Nic Hubbard over 12 yearsExactly what I was looking for! Thank you.
-
Vamshi Krishna over 7 yearsThis shows 'Cannot Connect' for any URL. Any updates ?