1. Qt
  2. QTBUG-22356

Investigate support for 3rd party JS libraries



      Research if and how we should support 3rd party javascript libraries from QML.

      JavaScript libraries may attempt to do things not allowed by the QML JS environment. For example:

      Modify native objects:

      Modify the global object:

      Many libraries seem to be looking for either a browser environment or a CommonJS-like environment:

      In some cases, existing libraries can be made to work with code like:

      var window = {}

      Possible solutions:

      • Many libraries introspect their JS environment and tweak their code to cater for different environments. We could offer a standard way to identify the QML environment, allowing libraries to tweak themselves to our environment as well
      • We could consider introducing a new pragma, or allowing ".pragma library" imports to do special things (e.g. have their own (private?) editable global object)
      • A pragma that bootstraps some sort of compatibility layer (like Envjs)

      Other notes:

        Issue Links

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.


          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Reported Reported Open Open
          1049d 7h 35m 1 Simon Hausmann 09/Sep/14 1:52 PM


            • Assignee:
              Michael Brasser (closed Nokia identity) (Inactive)
            • Votes:
              14 Vote for this issue
              18 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes