Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8144

Add SystemXHR as a solution for whitelist in FFOS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Proposed content

      In Firefox OS there is no concept of whitelisting a specific domain. Instead
      there is a special permission called
      [SystemXHR](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Permissions).
      There is a need to add this permission to `config.xml`:

      <platform name="firefoxos">
      <permission name="systemXHR" privileged="true" description="load data from server" />
      </platform>

      The `XMLHttpRequest` object needs to be instantiated with two parameters
      `mozAnon` and `mozSystem`:

      var request = new XMLHttpRequest(

      { mozAnon: true, mozSystem: true}

      );

      This solution is transparent so there is no difference for other platforms.

      Attachments

        Activity

          People

            zalun zalun
            zalun zalun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: