Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include getExecutionMode in docs #132

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/pages/scripting/javascript-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,27 @@ Set the maximum number of redirects to follow
req.setMaxRedirects(5);
```

### `getExecutionMode`
Get the current active execution mode

Returns `runner` or `standalone`

**Example**
```javascript
const mode = req.getExecutionMode();
```

### `getExecutionPlatform`
Get the plattform the request is running on

Returns `app` or `cli`

**Example**
```javascript
const mode = req.getExecutionPlatform();
```


## Response
This `res` variable is available inside your scripting and testing context.

Expand Down Expand Up @@ -276,4 +297,4 @@ You can also abort the run by explicitly setting the next request to `null`
**Example:**
```javascript
bru.setNextRequest(null); // aborts the run gracefully
```
```