openURL( )


Directs the mobile app to open the specified URL in the device's browser.

developer preview tag

The openURL() function returns a Promise that resolves when the navigation is successful.

Supported URL formats:

  • An external web address. For example, http(s)://.
  • A URI such as a phone number, geographic coordinates, social media link, or email. For example, mailto:@?subject=.
Method Declaration
Copy
function openURL(url: string): Promise<void>;
Method Parameters
urlstringRequired

The URL to open.

Open a URL in the device's browser
JavaScript
import wixNavigateMobile from "wix-navigate-mobile"; /* Sample url value: 'https://wa.me/15551234567?text=I%27m%20interested%20in%20your%20car%20for%20sale'*/ wixNavigateMobile .openURL(url) .then(() => { console.log("URL opened successfully!"); return; }) .catch((error) => { console.error(error); // Handle the error }); /* Promise resolves to void */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?