<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: WebKit on the iPhone (Part 2)</title>
	<atom:link href="http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/</link>
	<description>iCab related stuff; Mac, iPhone and Cocoa programming</description>
	<lastBuildDate>Fri, 03 Feb 2012 21:00:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Alexandr</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-2/#comment-20627</link>
		<dc:creator>Alexandr</dc:creator>
		<pubDate>Wed, 01 Feb 2012 12:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-20627</guid>
		<description>Hello. I wind trick for find window by &#039;name&#039;. It need for frames too.

&quot;try { if(eval(&#039;window.&#039;+&#039;winName&#039;+&#039;.document&#039;)) { alert(&#039;YES&#039;); } } catch(e) { alert(&#039;NO&#039;); }&quot;</description>
		<content:encoded><![CDATA[<p>Hello. I wind trick for find window by &#8216;name&#8217;. It need for frames too.</p>
<p>&#8220;try { if(eval(&#8216;window.&#8217;+'winName&#8217;+&#8217;.document&#8217;)) { alert(&#8216;YES&#8217;); } } catch(e) { alert(&#8216;NO&#8217;); }&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-2/#comment-14745</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Thu, 25 Aug 2011 20:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-14745</guid>
		<description>Thanks for the suggestion!</description>
		<content:encoded><![CDATA[<p>Thanks for the suggestion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-2/#comment-14736</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Thu, 25 Aug 2011 13:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-14736</guid>
		<description>@Frank
Yes, in case the link target is within the same page, shouldStartLoadWithRequest is not called, because there&#039;s nothing to load. The only action that is triggered by this link is to scroll the page to the new target.

If you need to catch user actions of these links, you have to install your own onclick handlers which will call your own javascript function whenever the link is clicked.</description>
		<content:encoded><![CDATA[<p>@Frank<br />
Yes, in case the link target is within the same page, shouldStartLoadWithRequest is not called, because there&#8217;s nothing to load. The only action that is triggered by this link is to scroll the page to the new target.</p>
<p>If you need to catch user actions of these links, you have to install your own onclick handlers which will call your own javascript function whenever the link is clicked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-14729</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Thu, 25 Aug 2011 02:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-14729</guid>
		<description>Hi Alexander,

Thanks for your awesome blog, it is very helpful!
I am wondering how to catch the url of links like &lt;a href=&quot;#content&quot; rel=&quot;nofollow&quot;&gt;Skip to this page&#039;s content&lt;/a&gt;. shouldStartLoadWithRequest would not be called in this case.

Thanks for your help!</description>
		<content:encoded><![CDATA[<p>Hi Alexander,</p>
<p>Thanks for your awesome blog, it is very helpful!<br />
I am wondering how to catch the url of links like &lt;a href=&#8221;#content&#8221; rel=&#8221;nofollow&#8221;>Skip to this page&#8217;s content&lt;/a>. shouldStartLoadWithRequest would not be called in this case.</p>
<p>Thanks for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brock</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13871</link>
		<dc:creator>Brock</dc:creator>
		<pubDate>Thu, 14 Jul 2011 05:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13871</guid>
		<description>@Alexander

Ok, back to the drawing boards. I downloaded your app and it works fine on the page as is. Very nice app by the way. I&#039;m going to keep fooling around and see if I can&#039;t get things working.</description>
		<content:encoded><![CDATA[<p>@Alexander</p>
<p>Ok, back to the drawing boards. I downloaded your app and it works fine on the page as is. Very nice app by the way. I&#8217;m going to keep fooling around and see if I can&#8217;t get things working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13834</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Tue, 12 Jul 2011 18:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13834</guid>
		<description>@Brock
What the page is doing is probably something like this:

&lt;a href=&quot;javascript:void()&quot; onclick=&quot;location.href=url&quot;&gt;

which should be just be done this way:

&lt;a href=&quot;url&quot;&gt;

Or if they need the onclick hander, they should return the value &quot;false&quot; for the onclick handler to tell the browser that the standard behavior of the browser (open the page from the HREF attribute) should not be done. Then they can just put the real URL into the HREF attribute and open the URL via onclick handler. Then the links would also work when javaScript is switched off, then the link your also work when it is used outside of the context of the web page, like when a browser reads the link  via contextual menu to open it in a new tab or the user wants to copy &amp; paste the like etc.</description>
		<content:encoded><![CDATA[<p>@Brock<br />
What the page is doing is probably something like this:</p>
<p>&lt;a href=&#8221;javascript:void()&#8221; onclick=&#8221;location.href=url&#8221;></p>
<p>which should be just be done this way:</p>
<p>&lt;a href=&#8221;url&#8221;></p>
<p>Or if they need the onclick hander, they should return the value &#8220;false&#8221; for the onclick handler to tell the browser that the standard behavior of the browser (open the page from the HREF attribute) should not be done. Then they can just put the real URL into the HREF attribute and open the URL via onclick handler. Then the links would also work when javaScript is switched off, then the link your also work when it is used outside of the context of the web page, like when a browser reads the link  via contextual menu to open it in a new tab or the user wants to copy &#038; paste the like etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brock</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13808</link>
		<dc:creator>Brock</dc:creator>
		<pubDate>Tue, 12 Jul 2011 00:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13808</guid>
		<description>@Alexander

Thanks. If I have access to the web developer, what do I have to get him to do to implement a better practice so that I could grab the link? Just use the HREF attribute? Is that something that could be done if the source files are being pulled from a database and those are the pdf links that are being opened? I.e. this is a court system that pulls records from an archaic database and displays the PDFs from the links.

Also, you&#039;re making me feel better about my limited programing as I can get webkit to open links that usually open in new windows, but I wasn&#039;t able to get those to work.</description>
		<content:encoded><![CDATA[<p>@Alexander</p>
<p>Thanks. If I have access to the web developer, what do I have to get him to do to implement a better practice so that I could grab the link? Just use the HREF attribute? Is that something that could be done if the source files are being pulled from a database and those are the pdf links that are being opened? I.e. this is a court system that pulls records from an archaic database and displays the PDFs from the links.</p>
<p>Also, you&#8217;re making me feel better about my limited programing as I can get webkit to open links that usually open in new windows, but I wasn&#8217;t able to get those to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13803</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Mon, 11 Jul 2011 17:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13803</guid>
		<description>@Brock
OK, nobody can prevent that web developers are doing stupid things ;-)

I guess the web page is using JavaScript to open the PDF files via onClick handler and uses these these handlers in &quot;A&quot; tags. And because the onClick handlers are already opening the PDF file, the HREF attribute seems to be useless and so the web developers inserted &quot;javascript:void(0)&quot; as URL in these HREF attributes, which is definitely not what should be done in this case. This is just a bad practice and also introduces usually many issues and should be avoided. One issue that you can no longer copy the link URL, because there&#039;s no link URL anymore. And for UIWebViews this means you can&#039;t directly control where these links will open, because the &quot;links&quot; itself are just &quot;dummies&quot;.</description>
		<content:encoded><![CDATA[<p>@Brock<br />
OK, nobody can prevent that web developers are doing stupid things <img src='http://www.icab.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I guess the web page is using JavaScript to open the PDF files via onClick handler and uses these these handlers in &#8220;A&#8221; tags. And because the onClick handlers are already opening the PDF file, the HREF attribute seems to be useless and so the web developers inserted &#8220;javascript:void(0)&#8221; as URL in these HREF attributes, which is definitely not what should be done in this case. This is just a bad practice and also introduces usually many issues and should be avoided. One issue that you can no longer copy the link URL, because there&#8217;s no link URL anymore. And for UIWebViews this means you can&#8217;t directly control where these links will open, because the &#8220;links&#8221; itself are just &#8220;dummies&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brock</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13787</link>
		<dc:creator>Brock</dc:creator>
		<pubDate>Sun, 10 Jul 2011 22:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13787</guid>
		<description>@Alexander
I am trying to open a link to pdf documents in a work website. The links all copy as &quot;javascript:void(0)&quot;. After clicked and loaded the link is to a specific document, one in particluar being &quot;http://incapture.epcounty.com/incaptureweb/ImagePDF/cjj5jn555xyb2nvibtrtb321.pdf&quot;

I understand and have seen UIWebView methods implemented in the controller file, correct? Specifically, in my app &quot;Story_2_testViewController.m&quot; is where I&#039;m placing your method to access the ModifyLinkTargets.js file. Right before my viewDidLoad method.</description>
		<content:encoded><![CDATA[<p>@Alexander<br />
I am trying to open a link to pdf documents in a work website. The links all copy as &#8220;javascript:void(0)&#8221;. After clicked and loaded the link is to a specific document, one in particluar being &#8220;http://incapture.epcounty.com/incaptureweb/ImagePDF/cjj5jn555xyb2nvibtrtb321.pdf&#8221;</p>
<p>I understand and have seen UIWebView methods implemented in the controller file, correct? Specifically, in my app &#8220;Story_2_testViewController.m&#8221; is where I&#8217;m placing your method to access the ModifyLinkTargets.js file. Right before my viewDidLoad method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13766</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Sat, 09 Jul 2011 21:46:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13766</guid>
		<description>@Brock
What exactly do you want to do with &quot;javascript:void(0);&quot;?

The delegate methods are those from the UIWebView class. You have to implement some of the delegate methods from your UIWebView class to be notified when the page has finished loading and you can execute the JavaScript code.</description>
		<content:encoded><![CDATA[<p>@Brock<br />
What exactly do you want to do with &#8220;javascript:void(0);&#8221;?</p>
<p>The delegate methods are those from the UIWebView class. You have to implement some of the delegate methods from your UIWebView class to be notified when the page has finished loading and you can execute the JavaScript code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brock</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13747</link>
		<dc:creator>Brock</dc:creator>
		<pubDate>Sat, 09 Jul 2011 06:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13747</guid>
		<description>Does the above work on &quot;javascript:void(0);&quot; What you describe above is what I&#039;m trying to get my app to do. However, I&#039;m lost on implementing your tutorial.
Per instructions on webkit iphone part 1,
1.created MyWebViewAdditions.h (.m) (pasted code from part 1)
2.created ModifyLinkTargets.js (pasted code from part 2)
3. I&#039;m not sure of where to put the delegate methods though. (in my existing apps delegate.m file or the MyWebViewAdditions.m file?

very nice tutorial. I&#039;m following what you&#039;re doing, just not how.</description>
		<content:encoded><![CDATA[<p>Does the above work on &#8220;javascript:void(0);&#8221; What you describe above is what I&#8217;m trying to get my app to do. However, I&#8217;m lost on implementing your tutorial.<br />
Per instructions on webkit iphone part 1,<br />
1.created MyWebViewAdditions.h (.m) (pasted code from part 1)<br />
2.created ModifyLinkTargets.js (pasted code from part 2)<br />
3. I&#8217;m not sure of where to put the delegate methods though. (in my existing apps delegate.m file or the MyWebViewAdditions.m file?</p>
<p>very nice tutorial. I&#8217;m following what you&#8217;re doing, just not how.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13694</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Thu, 07 Jul 2011 14:43:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13694</guid>
		<description>@Steven
Check out the NSURLProtocol class. Using this class you can write your own HTTP protocol handler, so all HTTP requests can be routed through your own code.</description>
		<content:encoded><![CDATA[<p>@Steven<br />
Check out the NSURLProtocol class. Using this class you can write your own HTTP protocol handler, so all HTTP requests can be routed through your own code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13692</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Thu, 07 Jul 2011 11:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13692</guid>
		<description>Hi Alexander,

Awesome blog and app. 

I&#039;m wondering if it&#039;s possible with UIWebview on iOS to intercept the web page request so as to re-direct to a proxy and feed the request there. i.e. www.bbc.com should go to proxy 192.168.1.10:1234 and use NTLM authentication. 

I&#039;ve tried by doing this in shouldStartLoadWithRequest using ASIHTTPRequest &amp; loadHTMLString but that doesn&#039;t bring back resources (images, css etc).

Is this even possible with UIWebView on iOS?</description>
		<content:encoded><![CDATA[<p>Hi Alexander,</p>
<p>Awesome blog and app. </p>
<p>I&#8217;m wondering if it&#8217;s possible with UIWebview on iOS to intercept the web page request so as to re-direct to a proxy and feed the request there. i.e. <a href="http://www.bbc.com" rel="nofollow">http://www.bbc.com</a> should go to proxy 192.168.1.10:1234 and use NTLM authentication. </p>
<p>I&#8217;ve tried by doing this in shouldStartLoadWithRequest using ASIHTTPRequest &amp; loadHTMLString but that doesn&#8217;t bring back resources (images, css etc).</p>
<p>Is this even possible with UIWebView on iOS?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13657</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Wed, 06 Jul 2011 08:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13657</guid>
		<description>@gema
No, iCab does not support these rich text fields and no other iOS browser does. The way how the iOS activates the virtual keyboard makes it impossible to use these rich text editors.

But the demo page of this rich text editor is able to detect an iOS browser and then simply falls back to a regular &quot;textarea&quot; element of HTML, so you can enter text on iPad/iPhone as well, but here it&#039;s a standard text field, not a rich text field.

The web page probably uses the &quot;UserAgent&quot; information to find out if the page is running on and iPad/iPhone and maybe other touch-based devices. 

The problem with rich text fields on touch.based devices with a virtual keyboard is that on these devices the keyboard is not attached and available all the time. The keyboard only opens when you actively activate a text field. But &quot;rich text editors&quot; on web pages are not &quot;real&quot; text fields, these are in Javacript programs which build up some HTML and CSS code and render it in an iframe so this whole thing looks like a text field with lots of properties and settings for all the features. But it&#039;s not a &quot;real&quot; text field the iOS would know of. The Rich text editor is then listening for keyboard events on document or window level, which is the main issue on touch-based devices with virtual keyboards. On a desktop computer where the keyboard is available all the time, you can create keyboard events all the time by pressing a key, even if no text field is &quot;listening&quot;. The OS delivers these keyboard events also to GUI elements or objects  which are not textfields. But on devices with virtual keyboards this does not work, because the keyboard is only activated when a textfield is activated, and in order to make rich text editors work, the virtual keyboard would have to be available all the time, even when no textfield is active.</description>
		<content:encoded><![CDATA[<p>@gema<br />
No, iCab does not support these rich text fields and no other iOS browser does. The way how the iOS activates the virtual keyboard makes it impossible to use these rich text editors.</p>
<p>But the demo page of this rich text editor is able to detect an iOS browser and then simply falls back to a regular &#8220;textarea&#8221; element of HTML, so you can enter text on iPad/iPhone as well, but here it&#8217;s a standard text field, not a rich text field.</p>
<p>The web page probably uses the &#8220;UserAgent&#8221; information to find out if the page is running on and iPad/iPhone and maybe other touch-based devices. </p>
<p>The problem with rich text fields on touch.based devices with a virtual keyboard is that on these devices the keyboard is not attached and available all the time. The keyboard only opens when you actively activate a text field. But &#8220;rich text editors&#8221; on web pages are not &#8220;real&#8221; text fields, these are in Javacript programs which build up some HTML and CSS code and render it in an iframe so this whole thing looks like a text field with lots of properties and settings for all the features. But it&#8217;s not a &#8220;real&#8221; text field the iOS would know of. The Rich text editor is then listening for keyboard events on document or window level, which is the main issue on touch-based devices with virtual keyboards. On a desktop computer where the keyboard is available all the time, you can create keyboard events all the time by pressing a key, even if no text field is &#8220;listening&#8221;. The OS delivers these keyboard events also to GUI elements or objects  which are not textfields. But on devices with virtual keyboards this does not work, because the keyboard is only activated when a textfield is activated, and in order to make rich text editors work, the virtual keyboard would have to be available all the time, even when no textfield is active.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gema</title>
		<link>http://www.icab.de/blog/2009/08/05/webkit-on-the-iphone-part-2/comment-page-1/#comment-13644</link>
		<dc:creator>gema</dc:creator>
		<pubDate>Wed, 06 Jul 2011 00:01:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=21#comment-13644</guid>
		<description>Hello Alexander,
I noticed that iCab Mobile can use rich text editors for forums like this example:
http://www.kevinroth.com/rte/demo.htm
I&#039;m trying to use it in a UIWebview but the keyboard doesn&#039;t appear when you tap on the edit text area. It&#039;s inside a &quot;iframe&quot; so maybe that&#039;s the problem...any clue on your side?

Thanks in advance!</description>
		<content:encoded><![CDATA[<p>Hello Alexander,<br />
I noticed that iCab Mobile can use rich text editors for forums like this example:<br />
<a href="http://www.kevinroth.com/rte/demo.htm" rel="nofollow">http://www.kevinroth.com/rte/demo.htm</a><br />
I&#8217;m trying to use it in a UIWebview but the keyboard doesn&#8217;t appear when you tap on the edit text area. It&#8217;s inside a &#8220;iframe&#8221; so maybe that&#8217;s the problem&#8230;any clue on your side?</p>
<p>Thanks in advance!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

