Skip to content

pxBrowser support for Window #244

@jmgasper

Description

@jmgasper

Overview

The goal of the pxBrowser project is to add support for web browser rendering inside of Spark / pxScene apps. This challenge will target just the Windows port to keep scope reasonable. A future challenge will add Mac support.

Spark apps can have multiple IViews. The pxBrowserView will be one pxIView that can be created using the code example provided below. The pxIView will be for the desktop only.

The goal of the sample app was to create a simple app that allowed for isolated development of the pxBrowserView. Once that is working then we would like to integrate pxBrowserView into Spark and launch the browser view using the scene.create() example like this:

var wv = scene.create({
  t:'browser',
  url: 'https://www.google.com'
});

Links

Notes

  • The attached example (see below) creates a window, a browser view container (pxIViewContainer), and a browser view (pxIView).
  • pxBrowserViewContainer has a pxBrowserView reference
  • The browser view in the example app simply renders a red rectangle right now, but we are going to fill in the details to render a webpage. See virtual void RT_STDCALL onDraw()
  • Please use the skeleton app below to fill in the details of pxBrowserView
  • pxBrowserView’s onDraw should render the desired web page

Rendering

The DirectFB code is unofficially deprecated, and the only path we currently need to support is OpenGL. Based on the Qt docs, this should work fine with the latest version of Qt.

Testing

Please provide very clear setup and testing documentation so that reviewers and the client can easily validate your submission.

APIs

Please implement the below APIs for pxBrowserViewContainer and pxBrowserView. These should be accessible as rtProperties and events:

Properties:

  • url - string
  • cookieJar - json
  • proxies - json
  • webfilter- json
  • userAgent - string
  • transparentBackground - bool
  • visible, getVisible - bool
  • localStorageEnabled - bool
  • consoleLogEnabled - bool
  • headers - object

Events:

  • onHTMLDocumentLoaded - where e.success, e.httpStatus are defined
  • onHTMLLinkClicked - where e.value is defined and is the URL of the link clicked
  • onConsoleLog - where e.logMessage is defined
  • struct onError - where e.errorType, e.description are defined
  • onCookieJarChanged
  • onLaunchMetrics

Example code

We can use this as the skeleton that we fill in for demonstration.

pxBrowserExample.cpp.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions