[英]iOS: UIWebView full open source browser?
Does anyone know if there are any open source solutions out there that use UIWebview to build a full browser?有谁知道是否有任何使用 UIWebview 构建完整浏览器的开源解决方案? There is something like this in Three20 when you pass a URL, but I am assuming there must be other alternatives out there.当您通过 URL 时, Three20 中有类似的东西,但我假设那里必须有其他替代方案。
I realize that UIWebView is a web browser, but hooking up refresh, back button, URL bar, etc will take extra time.我意识到 UIWebView 是 web 浏览器,但连接刷新、后退按钮、URL 栏等需要额外的时间。
Suggestions?建议?
SVWebViewController looks pretty much like what you're looking for. SVWebViewController看起来很像您正在寻找的东西。
https://github.com/ghostery/banshee https://github.com/ghostery/banshee
EDIT the project is now maintained here: https://github.com/acatighera/banshee编辑项目现在在这里维护: https://github.com/acatighera/banshee
It's an open source browser with tabs, bookmarks, search, etc.它是一个带有标签、书签、搜索等功能的开源浏览器。
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).我已经启动了一个开源项目(MIT 许可证),以尽可能接近原生 MobileSafari 应用程序(在 iPhone 和 iPad 上)。
Here are the features so far:以下是迄今为止的功能:
Anyone wanting to contribute to this project is welcome to do it !欢迎任何想为这个项目做出贡献的人来做!
You can clone/fork the project here: https://github.com/sylverb/CIALBrowser您可以在此处克隆/分叉该项目: https://github.com/sylverb/CIALBrowser
UIWebView
is a full browser ! UIWebView
是一个完整的浏览器! To open a url in webView
you do this -要在 webView 中打开webView
,请执行以下操作 -
NSURL *url = [NSURL URLWithString:webAddress];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[webView loadRequest:req];
You can even insert javascript into UIWebView
.您甚至可以将 javascript插入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.更新:要获得后退按钮和所有功能, webView
提供了这些功能,后退、前进等所有这些浏览器功能。 You need to code up the buttons & UI & for code you could do this -您需要编写按钮和 UI 以及可以执行此操作的代码 -
-(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];
}
You can also check out KINWebBrowser, a drop in web browser module for your apps.您还可以查看 KINWebBrowser,它是您应用程序的 web 浏览器模块中的一个插件。 https://github.com/dfmuir/KINWebBrowser https://github.com/dfmuir/KINWebBrowser
Features特征
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.