[ 
https://issues.apache.org/jira/browse/CB-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13772128#comment-13772128
 ] 

Mike Billau commented on CB-4819:
---------------------------------

Hi Peter,

After thinking about it a bit and reading your post, I'm convinced that you're 
correct and that I have no idea what I'm talking about ;) The tests seem to 
clearly show that you do need to pass in the callback to be removed; you can 
see this is the case in the code for channel.unsubscribe() [1] which is what 
gets executed when you call inAppBrowser.removeEventListener() [2]. In addition 
to this doc change, I think the full example is wrong when it calls 
removeEventListener('loaderror',iabLoadError) before that event was ever added. 

Submitted a pull request with your suggested change. Thanks.

Pull Request: https://github.com/apache/cordova-plugin-inappbrowser/pull/3


[1] https://github.com/apache/cordova-js/blob/master/lib/common/channel.js#L181
[2] 
https://github.com/apache/cordova-plugin-inappbrowser/blob/master/www/InAppBrowser.js#L52
                
> InAppBrowser.removeEventListener - description of callback parameter
> --------------------------------------------------------------------
>
>                 Key: CB-4819
>                 URL: https://issues.apache.org/jira/browse/CB-4819
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Docs
>    Affects Versions: 2.9.0
>            Reporter: Peter
>            Assignee: Michael Brooks
>            Priority: Minor
>
> The documentation for removeEventListener seems like a cut/paste error from 
> addEventListener.
> http://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#removeEventListener
>  says:
> {quote}
> *callback:* the function to execute when the event fires. The function is 
> passed an InAppBrowserEvent object.
> {quote}
> It might be better described as something like:
> {quote}
> *callback:* the function to be removed, which was previously registered for 
> this event by addEventListener
> {quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to