Skip to content

Commit

Permalink
Update documentation: browser, device and API (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
EzioLi01 authored Sep 11, 2023
1 parent c09cef1 commit 6aae6f8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ simulate [<platform>] [--device=<DEVICE_ID>] [--corsproxy=<true|false>] [--dir=<
See parameters description in the [API](#api) section.

## API

Use `require('cordova-simulate')` to launch a simulation via the API:

```JavaScript
Expand All @@ -37,7 +38,7 @@ Where `opts` is an object with the following properties (all optional):
Supported `windows` devices are `Lumia930`, `Lumia950` and `SurfacePro`. Supported generic devices (which will use the
`browser` platform) are `Generic320x480`, `Generic320x568`, `Generic360x640`, `Generic384x640`, `Generic412x732`,
`Generic768x1024`, `Generic800x1280` and `Generic1920x1080`.
* **target** - the name of the browser to launch your app in. Can be any of the following: `default`, `chrome`, `chromium`, `edge`, `firefox`, `ie`, `opera`, `safari`.
* **target** - the name of the browser to launch your app in. Can be any of the following: `default`, `chrome`, `edge`, `firefox`, `opera`, `safari`.
* **port** - the desired port for the server to use. Defaults to `8000`.
* **lang** - the language to display in the interface (does not impact console output). Supported values (case-insensitive)
are `cs` (Czech), `de` (German), `es` (Spanish), `fr` (French), `it` (Italian), `ja` (Japanese), `ko` (Korean), `pl` (Polish),
Expand All @@ -56,6 +57,13 @@ Where `opts` is an object with the following properties (all optional):
* **livereloaddelay** - the delay in milliseconds between saving of a modified file and the application page reloading. You can try to increase the delay in case the simulator server crashes while frequent page reloading. Defaults to `200ms`.
* **spaurlrewrites** - a boolean. Set to `true` to fix page refreshing in case the default application URL (`/index.html`) in the browser was changed by the router in single page applications. Defaults to `false`.

Use `launchBrowser` to open target browser with specific url:

```JavaScript
require('cordova-simulate').launchBrowser(target, url);
```
* **target** - which browser you want to open, like `Chrome`, `Edge`, `Firefox`, `Opera`, `Safari`.
* **url** - specific website url you want to load.

# What it does

Expand Down

0 comments on commit 6aae6f8

Please sign in to comment.