You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Shazron <sh...@gmail.com> on 2014/04/18 20:53:12 UTC

[iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Note: iOS 7 only.

Two ways to grab the JSContext:
1. Through KVC of the UIWebView object and key
"documentView.webView.mainFrame.javaScriptContext" [1]
2. Create a NSObject category for selector
"webView:didCreateJavaScriptContext:forFrame:" [2]

Usual caveats apply to whether any of these methods is acceptable for the
App Store.

[1]
http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
[2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by purplecabbage <pu...@gmail.com>.
+1 to test first. 
Any other path is risky IMHO. 

Sent from my iPhone

> On Apr 22, 2014, at 11:27 AM, Shazron <sh...@gmail.com> wrote:
> 
> I've always thought of it as a conditional compilation option (#ifdef
> DEBUG).
> A plugin is a good idea, that way it is isolated. The plugin would be an
> implementation of CDVCommandDelegate
> and would clobber
> https://github.com/apache/cordova-ios/blob/e7537107f02d6bc22a6dc8d68ea8685d2fd5cb8a/CordovaLib/Classes/CDVViewController.h#L50
> 
> 
> On Tue, Apr 22, 2014 at 11:16 AM, Andrew Grieve <ag...@chromium.org>wrote:
> 
>> Put it behind a compile-time flag? Implement it as a plugin?
>> 
>> 
>>> On Tue, Apr 22, 2014 at 1:56 PM, Michal Mocny <mm...@chromium.org> wrote:
>>> 
>>> Anyone have an app up on the ios app store that is willing to run a quick
>>> experiment?
>>> 
>>> 
>>> On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <iclelland@chromium.org
>>>> wrote:
>>> 
>>>> We would need to be careful -- including it as a bridge option might
>> mean
>>>> bundling the native support code with everyone's app builds.
>>>> 
>>>> Apple has been suspected of doing static analysis of all submitted
>>>> binaries, looking specifically for use of undocumented messages /
>>> features.
>>>> Just having the code in there that could potentially handle this bridge
>>>> might be poison for people submitting apps to the store.
>>>> 
>>>> Ian
>>>> 
>>>> 
>>>>> On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com>
>>>> wrote:
>>>> 
>>>>> Pretty neat stuff there.  We would have to be careful in adding it to
>>>> core
>>>>> for app submissions.  Perhaps a new target that includes it?
>>>>> -James Jong
>>>>> 
>>>>>> On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org>
>>>>> wrote:
>>>>> 
>>>>>> Like it! Also - in the linked blog post they show how to capture
>>>>>> console.log. Would be another good DEBUG-only option.
>>>>>> 
>>>>>> 
>>>>>> On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com>
>> wrote:
>>>>>> 
>>>>>>> Yup, thats what I was thinking as well :)
>>>>>>> 
>>>>>>> Another thing to add through this new method is to catch all JS
>>>>> exceptions
>>>>>>> and NSLog them natively, but there is already window.onerror, but
>>> not
>>>>>>> everyone uses it (or knows about it)...could be a DEBUG only
>> option
>>>>>>> 
>>>>>>> 
>>>>>>> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <
>>> agrieve@chromium.org>
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> Thanks for pointing this out! Very cool! Would allow for a much
>>> more
>>>>>>>> performance bridge on iOS.
>>>>>>>> 
>>>>>>>> Maybe we could add it is as an optional bridge mode and let users
>>>> that
>>>>>>> want
>>>>>>>> a faster bridge test the AppStore waters?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io>
>> wrote:
>>>>>>>> 
>>>>>>>>> This is awesome.
>>>>>>>>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
>>>>>>>>>> 
>>>>>>>>>> Note: iOS 7 only.
>>>>>>>>>> 
>>>>>>>>>> Two ways to grab the JSContext:
>>>>>>>>>> 1. Through KVC of the UIWebView object and key
>>>>>>>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
>>>>>>>>>> 2. Create a NSObject category for selector
>>>>>>>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
>>>>>>>>>> 
>>>>>>>>>> Usual caveats apply to whether any of these methods is
>> acceptable
>>>> for
>>>>>>>> the
>>>>>>>>>> App Store.
>>>>>>>>>> 
>>>>>>>>>> [1]
>> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
>>>>>>>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
>> 

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Shazron <sh...@gmail.com>.
I've always thought of it as a conditional compilation option (#ifdef
DEBUG).
A plugin is a good idea, that way it is isolated. The plugin would be an
implementation of CDVCommandDelegate
and would clobber
https://github.com/apache/cordova-ios/blob/e7537107f02d6bc22a6dc8d68ea8685d2fd5cb8a/CordovaLib/Classes/CDVViewController.h#L50


On Tue, Apr 22, 2014 at 11:16 AM, Andrew Grieve <ag...@chromium.org>wrote:

> Put it behind a compile-time flag? Implement it as a plugin?
>
>
> On Tue, Apr 22, 2014 at 1:56 PM, Michal Mocny <mm...@chromium.org> wrote:
>
> > Anyone have an app up on the ios app store that is willing to run a quick
> > experiment?
> >
> >
> > On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <iclelland@chromium.org
> > >wrote:
> >
> > > We would need to be careful -- including it as a bridge option might
> mean
> > > bundling the native support code with everyone's app builds.
> > >
> > > Apple has been suspected of doing static analysis of all submitted
> > > binaries, looking specifically for use of undocumented messages /
> > features.
> > > Just having the code in there that could potentially handle this bridge
> > > might be poison for people submitting apps to the store.
> > >
> > > Ian
> > >
> > >
> > > On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com>
> > wrote:
> > >
> > > > Pretty neat stuff there.  We would have to be careful in adding it to
> > > core
> > > > for app submissions.  Perhaps a new target that includes it?
> > > > -James Jong
> > > >
> > > > On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org>
> > > wrote:
> > > >
> > > > > Like it! Also - in the linked blog post they show how to capture
> > > > > console.log. Would be another good DEBUG-only option.
> > > > >
> > > > >
> > > > > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com>
> wrote:
> > > > >
> > > > >> Yup, thats what I was thinking as well :)
> > > > >>
> > > > >> Another thing to add through this new method is to catch all JS
> > > > exceptions
> > > > >> and NSLog them natively, but there is already window.onerror, but
> > not
> > > > >> everyone uses it (or knows about it)...could be a DEBUG only
> option
> > > > >>
> > > > >>
> > > > >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <
> > agrieve@chromium.org>
> > > > >> wrote:
> > > > >>
> > > > >>> Thanks for pointing this out! Very cool! Would allow for a much
> > more
> > > > >>> performance bridge on iOS.
> > > > >>>
> > > > >>> Maybe we could add it is as an optional bridge mode and let users
> > > that
> > > > >> want
> > > > >>> a faster bridge test the AppStore waters?
> > > > >>>
> > > > >>>
> > > > >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io>
> wrote:
> > > > >>>
> > > > >>>> This is awesome.
> > > > >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> > > > >>>>
> > > > >>>>> Note: iOS 7 only.
> > > > >>>>>
> > > > >>>>> Two ways to grab the JSContext:
> > > > >>>>> 1. Through KVC of the UIWebView object and key
> > > > >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> > > > >>>>> 2. Create a NSObject category for selector
> > > > >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > > > >>>>>
> > > > >>>>> Usual caveats apply to whether any of these methods is
> acceptable
> > > for
> > > > >>> the
> > > > >>>>> App Store.
> > > > >>>>>
> > > > >>>>> [1]
> > > > >>>>>
> > > > >>>>>
> > > > >>>
> > > > >>
> > > >
> > >
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > > > >>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > > > >>>>>
> > > > >>>>
> > > > >>>
> > > > >>
> > > >
> > > >
> > >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Michal Mocny <mm...@chromium.org>.
The point is, if it is certain to not pass review, why do any work at all?
 Lets just hack this into one project (heck, if they are using static
analysis, it doesn't even need to implement the bridge, just issue the
calls), and see what they say.

-Michal


On Tue, Apr 22, 2014 at 2:43 PM, Shazron <sh...@gmail.com> wrote:

> Brian - Yes they can, as I have theoretically proposed - but that property
> I showed is readonly, but this being Objective-C and the ability to use
> KVC, that won't stop us...
> Jesse - testing is a given, there shouldn't be any other way - isolating it
> as a plugin would give us this so it won't be in the core (labs?).
>
>
> On Tue, Apr 22, 2014 at 11:35 AM, Brian LeRoux <b...@brian.io> wrote:
>
> > can bridges be plugins? (if not: they totally should be / what an awesome
> > feature)
> >
> >
> > On Tue, Apr 22, 2014 at 11:16 AM, Andrew Grieve <agrieve@chromium.org
> > >wrote:
> >
> > > Put it behind a compile-time flag? Implement it as a plugin?
> > >
> > >
> > > On Tue, Apr 22, 2014 at 1:56 PM, Michal Mocny <mm...@chromium.org>
> > wrote:
> > >
> > > > Anyone have an app up on the ios app store that is willing to run a
> > quick
> > > > experiment?
> > > >
> > > >
> > > > On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <
> iclelland@chromium.org
> > > > >wrote:
> > > >
> > > > > We would need to be careful -- including it as a bridge option
> might
> > > mean
> > > > > bundling the native support code with everyone's app builds.
> > > > >
> > > > > Apple has been suspected of doing static analysis of all submitted
> > > > > binaries, looking specifically for use of undocumented messages /
> > > > features.
> > > > > Just having the code in there that could potentially handle this
> > bridge
> > > > > might be poison for people submitting apps to the store.
> > > > >
> > > > > Ian
> > > > >
> > > > >
> > > > > On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com>
> > > > wrote:
> > > > >
> > > > > > Pretty neat stuff there.  We would have to be careful in adding
> it
> > to
> > > > > core
> > > > > > for app submissions.  Perhaps a new target that includes it?
> > > > > > -James Jong
> > > > > >
> > > > > > On Apr 22, 2014, at 12:13 PM, Andrew Grieve <
> agrieve@chromium.org>
> > > > > wrote:
> > > > > >
> > > > > > > Like it! Also - in the linked blog post they show how to
> capture
> > > > > > > console.log. Would be another good DEBUG-only option.
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com>
> > > wrote:
> > > > > > >
> > > > > > >> Yup, thats what I was thinking as well :)
> > > > > > >>
> > > > > > >> Another thing to add through this new method is to catch all
> JS
> > > > > > exceptions
> > > > > > >> and NSLog them natively, but there is already window.onerror,
> > but
> > > > not
> > > > > > >> everyone uses it (or knows about it)...could be a DEBUG only
> > > option
> > > > > > >>
> > > > > > >>
> > > > > > >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <
> > > > agrieve@chromium.org>
> > > > > > >> wrote:
> > > > > > >>
> > > > > > >>> Thanks for pointing this out! Very cool! Would allow for a
> much
> > > > more
> > > > > > >>> performance bridge on iOS.
> > > > > > >>>
> > > > > > >>> Maybe we could add it is as an optional bridge mode and let
> > users
> > > > > that
> > > > > > >> want
> > > > > > >>> a faster bridge test the AppStore waters?
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io>
> > > wrote:
> > > > > > >>>
> > > > > > >>>> This is awesome.
> > > > > > >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com>
> > wrote:
> > > > > > >>>>
> > > > > > >>>>> Note: iOS 7 only.
> > > > > > >>>>>
> > > > > > >>>>> Two ways to grab the JSContext:
> > > > > > >>>>> 1. Through KVC of the UIWebView object and key
> > > > > > >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> > > > > > >>>>> 2. Create a NSObject category for selector
> > > > > > >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > > > > > >>>>>
> > > > > > >>>>> Usual caveats apply to whether any of these methods is
> > > acceptable
> > > > > for
> > > > > > >>> the
> > > > > > >>>>> App Store.
> > > > > > >>>>>
> > > > > > >>>>> [1]
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > > > > > >>>>> [2]
> > https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > > > > > >>>>>
> > > > > > >>>>
> > > > > > >>>
> > > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Shazron <sh...@gmail.com>.
Brian - Yes they can, as I have theoretically proposed - but that property
I showed is readonly, but this being Objective-C and the ability to use
KVC, that won't stop us...
Jesse - testing is a given, there shouldn't be any other way - isolating it
as a plugin would give us this so it won't be in the core (labs?).


On Tue, Apr 22, 2014 at 11:35 AM, Brian LeRoux <b...@brian.io> wrote:

> can bridges be plugins? (if not: they totally should be / what an awesome
> feature)
>
>
> On Tue, Apr 22, 2014 at 11:16 AM, Andrew Grieve <agrieve@chromium.org
> >wrote:
>
> > Put it behind a compile-time flag? Implement it as a plugin?
> >
> >
> > On Tue, Apr 22, 2014 at 1:56 PM, Michal Mocny <mm...@chromium.org>
> wrote:
> >
> > > Anyone have an app up on the ios app store that is willing to run a
> quick
> > > experiment?
> > >
> > >
> > > On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <iclelland@chromium.org
> > > >wrote:
> > >
> > > > We would need to be careful -- including it as a bridge option might
> > mean
> > > > bundling the native support code with everyone's app builds.
> > > >
> > > > Apple has been suspected of doing static analysis of all submitted
> > > > binaries, looking specifically for use of undocumented messages /
> > > features.
> > > > Just having the code in there that could potentially handle this
> bridge
> > > > might be poison for people submitting apps to the store.
> > > >
> > > > Ian
> > > >
> > > >
> > > > On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com>
> > > wrote:
> > > >
> > > > > Pretty neat stuff there.  We would have to be careful in adding it
> to
> > > > core
> > > > > for app submissions.  Perhaps a new target that includes it?
> > > > > -James Jong
> > > > >
> > > > > On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org>
> > > > wrote:
> > > > >
> > > > > > Like it! Also - in the linked blog post they show how to capture
> > > > > > console.log. Would be another good DEBUG-only option.
> > > > > >
> > > > > >
> > > > > > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com>
> > wrote:
> > > > > >
> > > > > >> Yup, thats what I was thinking as well :)
> > > > > >>
> > > > > >> Another thing to add through this new method is to catch all JS
> > > > > exceptions
> > > > > >> and NSLog them natively, but there is already window.onerror,
> but
> > > not
> > > > > >> everyone uses it (or knows about it)...could be a DEBUG only
> > option
> > > > > >>
> > > > > >>
> > > > > >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <
> > > agrieve@chromium.org>
> > > > > >> wrote:
> > > > > >>
> > > > > >>> Thanks for pointing this out! Very cool! Would allow for a much
> > > more
> > > > > >>> performance bridge on iOS.
> > > > > >>>
> > > > > >>> Maybe we could add it is as an optional bridge mode and let
> users
> > > > that
> > > > > >> want
> > > > > >>> a faster bridge test the AppStore waters?
> > > > > >>>
> > > > > >>>
> > > > > >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io>
> > wrote:
> > > > > >>>
> > > > > >>>> This is awesome.
> > > > > >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com>
> wrote:
> > > > > >>>>
> > > > > >>>>> Note: iOS 7 only.
> > > > > >>>>>
> > > > > >>>>> Two ways to grab the JSContext:
> > > > > >>>>> 1. Through KVC of the UIWebView object and key
> > > > > >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> > > > > >>>>> 2. Create a NSObject category for selector
> > > > > >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > > > > >>>>>
> > > > > >>>>> Usual caveats apply to whether any of these methods is
> > acceptable
> > > > for
> > > > > >>> the
> > > > > >>>>> App Store.
> > > > > >>>>>
> > > > > >>>>> [1]
> > > > > >>>>>
> > > > > >>>>>
> > > > > >>>
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > > > > >>>>> [2]
> https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > > > > >>>>>
> > > > > >>>>
> > > > > >>>
> > > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Brian LeRoux <b...@brian.io>.
can bridges be plugins? (if not: they totally should be / what an awesome
feature)


On Tue, Apr 22, 2014 at 11:16 AM, Andrew Grieve <ag...@chromium.org>wrote:

> Put it behind a compile-time flag? Implement it as a plugin?
>
>
> On Tue, Apr 22, 2014 at 1:56 PM, Michal Mocny <mm...@chromium.org> wrote:
>
> > Anyone have an app up on the ios app store that is willing to run a quick
> > experiment?
> >
> >
> > On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <iclelland@chromium.org
> > >wrote:
> >
> > > We would need to be careful -- including it as a bridge option might
> mean
> > > bundling the native support code with everyone's app builds.
> > >
> > > Apple has been suspected of doing static analysis of all submitted
> > > binaries, looking specifically for use of undocumented messages /
> > features.
> > > Just having the code in there that could potentially handle this bridge
> > > might be poison for people submitting apps to the store.
> > >
> > > Ian
> > >
> > >
> > > On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com>
> > wrote:
> > >
> > > > Pretty neat stuff there.  We would have to be careful in adding it to
> > > core
> > > > for app submissions.  Perhaps a new target that includes it?
> > > > -James Jong
> > > >
> > > > On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org>
> > > wrote:
> > > >
> > > > > Like it! Also - in the linked blog post they show how to capture
> > > > > console.log. Would be another good DEBUG-only option.
> > > > >
> > > > >
> > > > > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com>
> wrote:
> > > > >
> > > > >> Yup, thats what I was thinking as well :)
> > > > >>
> > > > >> Another thing to add through this new method is to catch all JS
> > > > exceptions
> > > > >> and NSLog them natively, but there is already window.onerror, but
> > not
> > > > >> everyone uses it (or knows about it)...could be a DEBUG only
> option
> > > > >>
> > > > >>
> > > > >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <
> > agrieve@chromium.org>
> > > > >> wrote:
> > > > >>
> > > > >>> Thanks for pointing this out! Very cool! Would allow for a much
> > more
> > > > >>> performance bridge on iOS.
> > > > >>>
> > > > >>> Maybe we could add it is as an optional bridge mode and let users
> > > that
> > > > >> want
> > > > >>> a faster bridge test the AppStore waters?
> > > > >>>
> > > > >>>
> > > > >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io>
> wrote:
> > > > >>>
> > > > >>>> This is awesome.
> > > > >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> > > > >>>>
> > > > >>>>> Note: iOS 7 only.
> > > > >>>>>
> > > > >>>>> Two ways to grab the JSContext:
> > > > >>>>> 1. Through KVC of the UIWebView object and key
> > > > >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> > > > >>>>> 2. Create a NSObject category for selector
> > > > >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > > > >>>>>
> > > > >>>>> Usual caveats apply to whether any of these methods is
> acceptable
> > > for
> > > > >>> the
> > > > >>>>> App Store.
> > > > >>>>>
> > > > >>>>> [1]
> > > > >>>>>
> > > > >>>>>
> > > > >>>
> > > > >>
> > > >
> > >
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > > > >>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > > > >>>>>
> > > > >>>>
> > > > >>>
> > > > >>
> > > >
> > > >
> > >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Andrew Grieve <ag...@chromium.org>.
Put it behind a compile-time flag? Implement it as a plugin?


On Tue, Apr 22, 2014 at 1:56 PM, Michal Mocny <mm...@chromium.org> wrote:

> Anyone have an app up on the ios app store that is willing to run a quick
> experiment?
>
>
> On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <iclelland@chromium.org
> >wrote:
>
> > We would need to be careful -- including it as a bridge option might mean
> > bundling the native support code with everyone's app builds.
> >
> > Apple has been suspected of doing static analysis of all submitted
> > binaries, looking specifically for use of undocumented messages /
> features.
> > Just having the code in there that could potentially handle this bridge
> > might be poison for people submitting apps to the store.
> >
> > Ian
> >
> >
> > On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com>
> wrote:
> >
> > > Pretty neat stuff there.  We would have to be careful in adding it to
> > core
> > > for app submissions.  Perhaps a new target that includes it?
> > > -James Jong
> > >
> > > On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org>
> > wrote:
> > >
> > > > Like it! Also - in the linked blog post they show how to capture
> > > > console.log. Would be another good DEBUG-only option.
> > > >
> > > >
> > > > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com> wrote:
> > > >
> > > >> Yup, thats what I was thinking as well :)
> > > >>
> > > >> Another thing to add through this new method is to catch all JS
> > > exceptions
> > > >> and NSLog them natively, but there is already window.onerror, but
> not
> > > >> everyone uses it (or knows about it)...could be a DEBUG only option
> > > >>
> > > >>
> > > >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <
> agrieve@chromium.org>
> > > >> wrote:
> > > >>
> > > >>> Thanks for pointing this out! Very cool! Would allow for a much
> more
> > > >>> performance bridge on iOS.
> > > >>>
> > > >>> Maybe we could add it is as an optional bridge mode and let users
> > that
> > > >> want
> > > >>> a faster bridge test the AppStore waters?
> > > >>>
> > > >>>
> > > >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:
> > > >>>
> > > >>>> This is awesome.
> > > >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> > > >>>>
> > > >>>>> Note: iOS 7 only.
> > > >>>>>
> > > >>>>> Two ways to grab the JSContext:
> > > >>>>> 1. Through KVC of the UIWebView object and key
> > > >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> > > >>>>> 2. Create a NSObject category for selector
> > > >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > > >>>>>
> > > >>>>> Usual caveats apply to whether any of these methods is acceptable
> > for
> > > >>> the
> > > >>>>> App Store.
> > > >>>>>
> > > >>>>> [1]
> > > >>>>>
> > > >>>>>
> > > >>>
> > > >>
> > >
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > > >>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > > >>>>>
> > > >>>>
> > > >>>
> > > >>
> > >
> > >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Michal Mocny <mm...@chromium.org>.
Anyone have an app up on the ios app store that is willing to run a quick
experiment?


On Tue, Apr 22, 2014 at 1:43 PM, Ian Clelland <ic...@chromium.org>wrote:

> We would need to be careful -- including it as a bridge option might mean
> bundling the native support code with everyone's app builds.
>
> Apple has been suspected of doing static analysis of all submitted
> binaries, looking specifically for use of undocumented messages / features.
> Just having the code in there that could potentially handle this bridge
> might be poison for people submitting apps to the store.
>
> Ian
>
>
> On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com> wrote:
>
> > Pretty neat stuff there.  We would have to be careful in adding it to
> core
> > for app submissions.  Perhaps a new target that includes it?
> > -James Jong
> >
> > On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
> >
> > > Like it! Also - in the linked blog post they show how to capture
> > > console.log. Would be another good DEBUG-only option.
> > >
> > >
> > > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com> wrote:
> > >
> > >> Yup, thats what I was thinking as well :)
> > >>
> > >> Another thing to add through this new method is to catch all JS
> > exceptions
> > >> and NSLog them natively, but there is already window.onerror, but not
> > >> everyone uses it (or knows about it)...could be a DEBUG only option
> > >>
> > >>
> > >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <ag...@chromium.org>
> > >> wrote:
> > >>
> > >>> Thanks for pointing this out! Very cool! Would allow for a much more
> > >>> performance bridge on iOS.
> > >>>
> > >>> Maybe we could add it is as an optional bridge mode and let users
> that
> > >> want
> > >>> a faster bridge test the AppStore waters?
> > >>>
> > >>>
> > >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:
> > >>>
> > >>>> This is awesome.
> > >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> > >>>>
> > >>>>> Note: iOS 7 only.
> > >>>>>
> > >>>>> Two ways to grab the JSContext:
> > >>>>> 1. Through KVC of the UIWebView object and key
> > >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> > >>>>> 2. Create a NSObject category for selector
> > >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > >>>>>
> > >>>>> Usual caveats apply to whether any of these methods is acceptable
> for
> > >>> the
> > >>>>> App Store.
> > >>>>>
> > >>>>> [1]
> > >>>>>
> > >>>>>
> > >>>
> > >>
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > >>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > >>>>>
> > >>>>
> > >>>
> > >>
> >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Ian Clelland <ic...@chromium.org>.
We would need to be careful -- including it as a bridge option might mean
bundling the native support code with everyone's app builds.

Apple has been suspected of doing static analysis of all submitted
binaries, looking specifically for use of undocumented messages / features.
Just having the code in there that could potentially handle this bridge
might be poison for people submitting apps to the store.

Ian


On Tue, Apr 22, 2014 at 1:38 PM, James Jong <wj...@gmail.com> wrote:

> Pretty neat stuff there.  We would have to be careful in adding it to core
> for app submissions.  Perhaps a new target that includes it?
> -James Jong
>
> On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org> wrote:
>
> > Like it! Also - in the linked blog post they show how to capture
> > console.log. Would be another good DEBUG-only option.
> >
> >
> > On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com> wrote:
> >
> >> Yup, thats what I was thinking as well :)
> >>
> >> Another thing to add through this new method is to catch all JS
> exceptions
> >> and NSLog them natively, but there is already window.onerror, but not
> >> everyone uses it (or knows about it)...could be a DEBUG only option
> >>
> >>
> >> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <ag...@chromium.org>
> >> wrote:
> >>
> >>> Thanks for pointing this out! Very cool! Would allow for a much more
> >>> performance bridge on iOS.
> >>>
> >>> Maybe we could add it is as an optional bridge mode and let users that
> >> want
> >>> a faster bridge test the AppStore waters?
> >>>
> >>>
> >>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:
> >>>
> >>>> This is awesome.
> >>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> >>>>
> >>>>> Note: iOS 7 only.
> >>>>>
> >>>>> Two ways to grab the JSContext:
> >>>>> 1. Through KVC of the UIWebView object and key
> >>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
> >>>>> 2. Create a NSObject category for selector
> >>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
> >>>>>
> >>>>> Usual caveats apply to whether any of these methods is acceptable for
> >>> the
> >>>>> App Store.
> >>>>>
> >>>>> [1]
> >>>>>
> >>>>>
> >>>
> >>
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> >>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> >>>>>
> >>>>
> >>>
> >>
>
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by James Jong <wj...@gmail.com>.
Pretty neat stuff there.  We would have to be careful in adding it to core for app submissions.  Perhaps a new target that includes it?
-James Jong

On Apr 22, 2014, at 12:13 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Like it! Also - in the linked blog post they show how to capture
> console.log. Would be another good DEBUG-only option.
> 
> 
> On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com> wrote:
> 
>> Yup, thats what I was thinking as well :)
>> 
>> Another thing to add through this new method is to catch all JS exceptions
>> and NSLog them natively, but there is already window.onerror, but not
>> everyone uses it (or knows about it)...could be a DEBUG only option
>> 
>> 
>> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <ag...@chromium.org>
>> wrote:
>> 
>>> Thanks for pointing this out! Very cool! Would allow for a much more
>>> performance bridge on iOS.
>>> 
>>> Maybe we could add it is as an optional bridge mode and let users that
>> want
>>> a faster bridge test the AppStore waters?
>>> 
>>> 
>>> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:
>>> 
>>>> This is awesome.
>>>> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
>>>> 
>>>>> Note: iOS 7 only.
>>>>> 
>>>>> Two ways to grab the JSContext:
>>>>> 1. Through KVC of the UIWebView object and key
>>>>> "documentView.webView.mainFrame.javaScriptContext" [1]
>>>>> 2. Create a NSObject category for selector
>>>>> "webView:didCreateJavaScriptContext:forFrame:" [2]
>>>>> 
>>>>> Usual caveats apply to whether any of these methods is acceptable for
>>> the
>>>>> App Store.
>>>>> 
>>>>> [1]
>>>>> 
>>>>> 
>>> 
>> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
>>>>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
>>>>> 
>>>> 
>>> 
>> 


Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Andrew Grieve <ag...@chromium.org>.
Like it! Also - in the linked blog post they show how to capture
console.log. Would be another good DEBUG-only option.


On Tue, Apr 22, 2014 at 11:48 AM, Shazron <sh...@gmail.com> wrote:

> Yup, thats what I was thinking as well :)
>
> Another thing to add through this new method is to catch all JS exceptions
> and NSLog them natively, but there is already window.onerror, but not
> everyone uses it (or knows about it)...could be a DEBUG only option
>
>
> On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> > Thanks for pointing this out! Very cool! Would allow for a much more
> > performance bridge on iOS.
> >
> > Maybe we could add it is as an optional bridge mode and let users that
> want
> > a faster bridge test the AppStore waters?
> >
> >
> > On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:
> >
> > > This is awesome.
> > > On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> > >
> > >> Note: iOS 7 only.
> > >>
> > >> Two ways to grab the JSContext:
> > >> 1. Through KVC of the UIWebView object and key
> > >> "documentView.webView.mainFrame.javaScriptContext" [1]
> > >> 2. Create a NSObject category for selector
> > >> "webView:didCreateJavaScriptContext:forFrame:" [2]
> > >>
> > >> Usual caveats apply to whether any of these methods is acceptable for
> > the
> > >> App Store.
> > >>
> > >> [1]
> > >>
> > >>
> >
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> > >> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> > >>
> > >
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Shazron <sh...@gmail.com>.
Yup, thats what I was thinking as well :)

Another thing to add through this new method is to catch all JS exceptions
and NSLog them natively, but there is already window.onerror, but not
everyone uses it (or knows about it)...could be a DEBUG only option


On Tue, Apr 22, 2014 at 8:43 AM, Andrew Grieve <ag...@chromium.org> wrote:

> Thanks for pointing this out! Very cool! Would allow for a much more
> performance bridge on iOS.
>
> Maybe we could add it is as an optional bridge mode and let users that want
> a faster bridge test the AppStore waters?
>
>
> On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:
>
> > This is awesome.
> > On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
> >
> >> Note: iOS 7 only.
> >>
> >> Two ways to grab the JSContext:
> >> 1. Through KVC of the UIWebView object and key
> >> "documentView.webView.mainFrame.javaScriptContext" [1]
> >> 2. Create a NSObject category for selector
> >> "webView:didCreateJavaScriptContext:forFrame:" [2]
> >>
> >> Usual caveats apply to whether any of these methods is acceptable for
> the
> >> App Store.
> >>
> >> [1]
> >>
> >>
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> >> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
> >>
> >
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Andrew Grieve <ag...@chromium.org>.
Thanks for pointing this out! Very cool! Would allow for a much more
performance bridge on iOS.

Maybe we could add it is as an optional bridge mode and let users that want
a faster bridge test the AppStore waters?


On Fri, Apr 18, 2014 at 9:38 PM, Brian LeRoux <b...@brian.io> wrote:

> This is awesome.
> On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:
>
>> Note: iOS 7 only.
>>
>> Two ways to grab the JSContext:
>> 1. Through KVC of the UIWebView object and key
>> "documentView.webView.mainFrame.javaScriptContext" [1]
>> 2. Create a NSObject category for selector
>> "webView:didCreateJavaScriptContext:forFrame:" [2]
>>
>> Usual caveats apply to whether any of these methods is acceptable for the
>> App Store.
>>
>> [1]
>>
>> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
>> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
>>
>

Re: [iOS] Objective-C object binding to UIWebWiew's JavaScriptCore

Posted by Brian LeRoux <b...@brian.io>.
This is awesome.
On Apr 18, 2014 12:02 PM, "Shazron" <sh...@gmail.com> wrote:

> Note: iOS 7 only.
>
> Two ways to grab the JSContext:
> 1. Through KVC of the UIWebView object and key
> "documentView.webView.mainFrame.javaScriptContext" [1]
> 2. Create a NSObject category for selector
> "webView:didCreateJavaScriptContext:forFrame:" [2]
>
> Usual caveats apply to whether any of these methods is acceptable for the
> App Store.
>
> [1]
>
> http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
> [2] https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
>