Bug 94621

Summary: [BlackBerry] Add option to only add JavaScript object 'qnx' to private webviews
Product: WebKit Reporter: Benjamin Meyer <ben>
Component: WebKit BlackBerryAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mifenton, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch none

Description Benjamin Meyer 2012-08-21 11:46:15 PDT
Currently the BlackBerry port is injecting the 'qnx' JavaScript object in every WebView to provide a way for JavaScript to callback out to native through an event.  This qnx object is injected in both WebViews that are used for interacting with local resources (local webpage) and WebViews that are used for displaying public webpages (aka http://www.google.com)

As long as the current codebase has a 'qnx' object there should be a way to enable/disable the injections so it can be turned off by default on WebView's loading public webpages to prevent any possible security risk.
Comment 1 Benjamin Meyer 2012-08-21 12:41:42 PDT
Created attachment 159741 [details]
patch
Comment 2 Yong Li 2012-08-21 12:51:02 PDT
Comment on attachment 159741 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=159741&action=review

> Source/WebKit/blackberry/Api/WebPage.h:387
> +    void enableQnxJavaScriptObject(bool);

Naming:
1. Qnx should be QNX
2. WebKit usually use setFooEnabled(boo)
Comment 3 Yong Li 2012-08-21 12:52:02 PDT
Comment on attachment 159741 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=159741&action=review

>> Source/WebKit/blackberry/Api/WebPage.h:387
>> +    void enableQnxJavaScriptObject(bool);
> 
> Naming:
> 1. Qnx should be QNX
> 2. WebKit usually use setFooEnabled(boo)

hm.. probably Qnx is ok because the js object is "qnx"
Comment 4 Benjamin Meyer 2012-08-21 13:09:40 PDT
On the API note, the BlackBerry port api is inconsistent, has setFooEnabled(),  enableFoo() and setEnableFoo() which is why I just picked one.
Comment 5 WebKit Review Bot 2012-08-21 17:18:21 PDT
Comment on attachment 159741 [details]
patch

Clearing flags on attachment: 159741

Committed r126232: <http://trac.webkit.org/changeset/126232>
Comment 6 WebKit Review Bot 2012-08-21 17:18:24 PDT
All reviewed patches have been landed.  Closing bug.