Bug 94621 - [BlackBerry] Add option to only add JavaScript object 'qnx' to private webviews
Summary: [BlackBerry] Add option to only add JavaScript object 'qnx' to private webviews
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 11:46 PDT by Benjamin Meyer
Modified: 2012-08-21 17:18 PDT (History)
3 users (show)

See Also:


Attachments
patch (4.27 KB, patch)
2012-08-21 12:41 PDT, Benjamin Meyer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.