> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# chrome_js

> This uses AppleEvents to execute the specified JavaScript code into a specific browser tab. The chrome_tabs function will specify the window/tab numbers that you can use for this function.

## Summary

This uses AppleEvents to execute the specified JavaScript code into a specific browser tab. The `chrome_tab`s function will specify the window/tab numbers that you can use for this function.

<Info>
  By default this ability is disabled in Chrome now, you will need to go to view->Developer->Allow JavaScript from Apple Events.
</Info>

* Needs Admin: False
* Version: 1
* Author: @its\_a\_feature\_

### Arguments

#### window

* Description: Window # from chrome\_tabs
* Required Value: True
* Default Value: None

#### javascript

* Description: javascript to execute
* Required Value: True
* Default Value: None

#### tab

* Description: Tab # from chrome\_tabs
* Required Value: True
* Default Value: None

## Usage

```
chrome_js
```

## MITRE ATT\&CK Mapping

* T1106
* T1064

## Detailed Summary

This boils down to a simple AppleEvent message:

```javascript theme={null}
let result = Application("Google Chrome").windows[window].tabs[tab].execute({javascript:jscript});
```
