Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor/browser

Package Overview
Dependencies
Maintainers
8
Versions
682
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/browser

The Browser API provides the ability to open an in-app browser and subscribe to browser events.

  • 6.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created

What is @capacitor/browser?

@capacitor/browser is a Capacitor plugin that provides functionality to open an in-app browser within a Capacitor-based application. It allows developers to open URLs in a browser view that is embedded within the app, providing a seamless user experience.

What are @capacitor/browser's main functionalities?

Open a URL

This feature allows you to open a specified URL in an in-app browser. The code sample demonstrates how to use the `open` method from the `Browser` module to open 'https://example.com'.

const { Browser } = require('@capacitor/browser');

async function openUrl() {
  await Browser.open({ url: 'https://example.com' });
}

openUrl();

Close the Browser

This feature allows you to programmatically close the in-app browser. The code sample demonstrates how to use the `close` method from the `Browser` module to close the browser.

const { Browser } = require('@capacitor/browser');

async function closeBrowser() {
  await Browser.close();
}

closeBrowser();

Listen for Browser Events

This feature allows you to listen for events such as when the browser is closed or when a new page is loaded. The code sample demonstrates how to use the `addListener` method to listen for `browserFinished` and `browserPageLoaded` events.

const { Browser } = require('@capacitor/browser');

Browser.addListener('browserFinished', () => {
  console.log('Browser is closed');
});

Browser.addListener('browserPageLoaded', () => {
  console.log('New page loaded in the browser');
});

Other packages similar to @capacitor/browser

Keywords

FAQs

Package last updated on 19 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc