https://github.com/aeharding/capacitor-reader
https://github.com/aeharding/capacitor-reader
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aeharding/capacitor-reader
- Owner: aeharding
- Created: 2024-11-16T18:20:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-26T01:43:14.000Z (over 1 year ago)
- Last Synced: 2025-06-30T03:49:22.878Z (about 1 year ago)
- Language: Swift
- Size: 563 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# capacitor-reader
Opens a simplified in app browser, prioritizing readability.
If you're looking for additional functionality, this plugin is not for you. ;)
## Install
```bash
npm install capacitor-reader
npx cap sync
```
## API
* [`open(...)`](#open)
* [`addListener('browserFinished', ...)`](#addlistenerbrowserfinished-)
* [Interfaces](#interfaces)
### open(...)
```typescript
open(options: CapacitorReaderOpenOptions) => Promise
```
iOS & Android only
| Param | Type |
| ------------- | --------------------------------------------------------------------------------- |
| **`options`** | CapacitorReaderOpenOptions |
--------------------
### addListener('browserFinished', ...)
```typescript
addListener(eventName: 'browserFinished', listenerFunc: () => void) => Promise
```
iOS only: Listen for the browser finished event.
It fires when the Browser is closed by the user.
This is necessary for those that want to track
iOS status taps (since capacitor swizzles all
iOS navigation taps)
| Param | Type |
| ------------------ | ------------------------------ |
| **`eventName`** | 'browserFinished' |
| **`listenerFunc`** | () => void |
**Returns:** Promise<PluginListenerHandle>
--------------------
### Interfaces
#### CapacitorReaderOpenOptions
| Prop | Type | Description | Default |
| ----------------------------- | -------------------- | -------------------------------------------------- | ------------------ |
| **`url`** | string | | |
| **`toolbarColor`** | string | The color of the toolbar | |
| **`entersReaderIfAvailable`** | boolean | Whether to enter reader mode if available iOS only | false |
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** | () => Promise<void> |