Home > Uncategorized > Webworks.js – under the hood on port 8472

Webworks.js – under the hood on port 8472

Image

A relatively recent change to Webworks apps on BB10, was that you had to include the file:

<script src=”local:///chrome/webworks.js” type=”text/javascript”></script> in order to access the native functionality, such as browser invoke etc. 

Interestingly, if you enable remote web inspector, you can actually see the contents of this file (listed here), and the underlying “gubbins” are exposed.

What webworks.js is actually doing, is that it converts calls such as blackberry.invoke.invoke({target: “sys.browser”,uri: “xxxx”}); to an AJAX call to localhost on port 8472, which does not appear to be accessible from outside the device itself.

The full protocol is unlikely to be published, and it’s not a good idea to use this protocol directly, it’s more for academic interest.

Here is an example AJAX request

  1. Request URL:
  2. Request Method:
    POST
  3. Status Code:

    200 OK
  4. Request Headersview source
    1. Accept-Language:
      en-GB,en;q=0.8
    2. Content-Type:
      application/json
    3. Origin:
      local://
    4. User-Agent:
      Mozilla/5.0 (BB10; Touch) AppleWebKit/537.35+ (KHTML, like Gecko) Version/10.2.1.2141 Mobile Safari/537.35+
  5. Request Payloadview source
     
    {,…}
    1. request“%7B%22target%22%3A%22sys.browser%22%2C%22uri%22%3A%22http%3A%2F%2Fwww.google.com%2Fpatents%2FUSD293241%3Fdq%3DResearch%2Bin%2BMotionw%26source%3Duds%22%7D”
  6. Response Headersview source
    1. Access-Control-Allow-Headers:
      Content-Type
    2. Access-Control-Allow-Origin:
      *, local://

 

 

 

 

 

 

 

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: