Opening a URL in the default system web browser

You can use the navigateToURL() function to open a URL in the default system web browser. For the URLRequest object you pass as the request parameter of this function, only the url property is used.

Note: When using the navigateToURL() function, the runtime treats a URLRequest object that uses the POST method (one that has its method property set to URLRequestMethod.POST) as using the GET method.

When using the navigateToURL() function, URL schemes are permitted based on the security sandbox of the code calling the navigateToURL() function.

Some APIs allow you to launch content in a web browser. For security reasons, some URL schemes are prohibited when using these APIs in AIR. The list of prohibited schemes depends on the security sandbox of the code using the API. (For details on security sandboxes, see AIR security.)

Application sandbox

The following schemes are allowed. Use these as you would use them in a web browser.

  • http:

  • https:

  • file:

  • mailto: — AIR directs these requests to the registered system mail application

  • app:

  • app-storage:

All other URL schemes are prohibited.

Remote sandbox

The following schemes are allowed. Use these as you would use them in a web browser.

  • http:

  • https:

  • mailto: — AIR directs these requests to the registered system mail application

All other URL schemes are prohibited.

Local-with-file sandbox

The following schemes are allowed. Use these as you would use them in a web browser.

  • file:

  • mailto: — AIR directs these requests to the registered system mail application

All other URL schemes are prohibited.

Local-with-networking sandbox

The following schemes are allowed. Use these as you would use them in a web browser.

  • http:

  • https:

  • mailto: — AIR directs these requests to the registered system mail application

All other URL schemes are prohibited.

Local-trusted sandbox

The following schemes are allowed. Use these as you would use them in a web browser.

  • file:

  • http:

  • https:

  • mailto: — AIR directs these requests to the registered system mail application

All other URL schemes are prohibited.