Socket
Book a DemoInstallSign in
Socket

capacitor-inappbrowser-with-cookies

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-inappbrowser-with-cookies

Capacitor plugin in app browser

1.2.19
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@capgo/inappbrowser

Capgo - Instant updates for capacitor

Capacitor plugin in app browser with urlChangeEvent

Install

npm install @capgo/inappbrowser
npx cap sync

Usage

import { InAppBrowser } from '@capgo/inappbrowser'

InAppBrowser.open({ url: "YOUR_URL" });

Camera usage

if you need the Camera to work in Android, you need to add the following to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.CAMERA" />

Then the permission will be asked when the camera is used.

API

open(...)

open(options: OpenOptions) => Promise<any>

Open url in a new window fullscreen

ParamType
optionsOpenOptions

Returns: Promise<any>

Since: 0.1.0

clearCookies()

clearCookies() => Promise<any>

Clear all cookies

Returns: Promise<any>

Since: 0.5.0

getCookies(...)

getCookies(options: GetCookieOptions) => Promise<{ cookies: Record<string, string>; }>

Get cookies for a specific URL.

ParamTypeDescription
optionsGetCookieOptionsThe options, including the URL to get cookies for.

Returns: Promise<{ cookies: Record<string, string>; }>

close()

close() => Promise<any>

Returns: Promise<any>

openWebView(...)

openWebView(options: OpenWebViewOptions) => Promise<any>

Open url in a new webview with toolbars

ParamType
optionsOpenWebViewOptions

Returns: Promise<any>

Since: 0.1.0

setUrl(...)

setUrl(options: { url: string; }) => Promise<any>
ParamType
options{ url: string; }

Returns: Promise<any>

addListener('urlChangeEvent', ...)

addListener(eventName: "urlChangeEvent", listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for url change, only for openWebView

ParamType
eventName'urlChangeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1

addListener('closeEvent', ...)

addListener(eventName: "closeEvent", listenerFunc: UrlChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for close click only for openWebView

ParamType
eventName'closeEvent'
listenerFuncUrlChangeListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.4.0

addListener('confirmBtnClicked', ...)

addListener(eventName: "confirmBtnClicked", listenerFunc: ConfirmBtnListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Will be triggered when user clicks on confirm button when disclaimer is required, works only on iOS

ParamType
eventName'confirmBtnClicked'
listenerFuncConfirmBtnListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1

removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 1.0.0

reload()

reload() => Promise<any>

Reload the current web page.

Returns: Promise<any>

Since: 1.0.0

Interfaces

OpenOptions

PropTypeDescriptionSince
urlstringTarget URL to load.0.1.0
headersHeadersHeaders to send with the request.0.1.0
isPresentAfterPageLoadbooleanif true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.0.1.0
preventDeeplinkboolean

Headers

GetCookieOptions

PropType
urlstring
includeHttpOnlyboolean

HttpCookie

PropType
urlstring
keystring
valuestring

OpenWebViewOptions

PropTypeDescriptionDefaultSince
urlstringTarget URL to load.0.1.0
headersHeadersHeaders to send with the request.0.1.0
shareDisclaimerDisclaimerOptionsshare options0.1.0
toolbarTypeToolBarTypeToolbar typeToolBarType.DEFAULT0.1.0
shareSubjectstringShare subject0.1.0
titlestringTitle of the browser'New Window'0.1.0
backgroundColorBackgroundColorBackground color of the browser, only on IOSBackgroundColor.BLACK0.1.0
isPresentAfterPageLoadbooleanOpen url in a new window fullscreen isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.false0.1.0
showReloadButtonbooleanShows a reload button that reloads the web pagefalse1.0.15
closeModalbooleanCloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately.false1.1.0
closeModalTitlestringCloseModalTitle: title of the confirm when user clicks on close button, only on IOS'Close'1.1.0
closeModalDescriptionstringCloseModalDescription: description of the confirm when user clicks on close button, only on IOS'Are you sure you want to close this window?'1.1.0
closeModalOkstringCloseModalOk: text of the confirm button when user clicks on close button, only on IOS'Close'1.1.0
closeModalCancelstringCloseModalCancel: text of the cancel button when user clicks on close button, only on IOS'Cancel'1.1.0
visibleTitlebooleanvisibleTitle: if true the website title would be shown else shown emptytrue1.2.5
toolbarColorstringtoolbarColor: color of the toolbar in hex format'#ffffff''1.2.5
showArrowbooleanshowArrow: if true an arrow would be shown instead of cross for closing the windowfalse1.2.5

DisclaimerOptions

PropType
titlestring
messagestring
confirmBtnstring
cancelBtnstring

PluginListenerHandle

PropType
remove() => Promise<void>

UrlEvent

PropTypeDescriptionSince
urlstringEmit when the url changes0.0.1

BtnEvent

PropTypeDescriptionSince
urlstringEmit when a button is clicked.0.0.1

Type Aliases

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

GetCookieOptions

Omit<HttpCookie, 'key' | 'value'>

Omit

Construct a type with the properties of T except for those in type K.

Pick<T, Exclude<keyof T, K>>

Pick

From T, pick a set of properties whose keys are in the union K

{ [P in K]: T[P]; }

Exclude

Exclude from T those types that are assignable to U

T extends U ? never : T

UrlChangeListener

(state: UrlEvent): void

ConfirmBtnListener

(state: BtnEvent): void

Enums

ToolBarType

MembersValue
ACTIVITY"activity"
NAVIGATION"navigation"
BLANK"blank"
DEFAULT""

BackgroundColor

MembersValue
WHITE"white"
BLACK"black"

Credits

Keywords

capacitor

FAQs

Package last updated on 28 Nov 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.