Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ browserstack.err
package.tgz
docs/
*.tsbuildinfo
/developer-extension/.output
/developer-extension/dist
/developer-extension/.wxt

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
Expand Down
50 changes: 25 additions & 25 deletions developer-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,7 @@ Browser extension to investigate your Browser SDK integration.

### From the Chrome Web Store

The extension is available to **Datadog employees** on the [Chrome Web Store](https://chrome.google.com/webstore/detail/datadog-browser-sdk-devel/boceobohkgenpcpogecpjlnmnfbdigda).

### By loading the extension unpacked

The packed extension is not (yet?) published publicly. You will need to clone this repository and
build the extension manually.

```
$ git clone https://github.com/DataDog/browser-sdk
$ cd browser-sdk
$ yarn
$ yarn build
```

Then, in Google Chrome:

- Open the _Extension Management_ page by navigating to [chrome://extensions](chrome://extensions).
- Enable _Developer Mode_ by clicking the toggle switch next to _Developer mode_.
- Click the _LOAD UNPACKED_ button and select the `browser-sdk/developer-extension/dist`
directory.
- Open devtools and the extension features are located on the `Browser SDK` panel.
The extension is available on the [Chrome Web Store](https://chrome.google.com/webstore/detail/datadog-browser-sdk-devel/boceobohkgenpcpogecpjlnmnfbdigda).

## Features

Expand Down Expand Up @@ -90,13 +70,33 @@ Info tab contains information about Session and RUM SDK configurations
Read the [Extend the developers
tools](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools)
MDN guide to get up to speed with WebExtensions for devtools. In particular, look for the
various entrypoints (panel.html, devtools.html) and the content script communication, as it'
s not straightforward.
various entrypoints (panel.html, devtools.html) and the content script communication, as it's not straightforward.

### By loading the extension unpacked
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't clear to me what this header means: is loading the extension unpacked an alternative to using the dev server? If so, I would drop the "by" and potentially add a sentence above mentioning that there are two options here.


You will need to clone this repository and build the extension manually.

```
$ git clone https://github.com/DataDog/browser-sdk
$ cd browser-sdk
$ yarn
$ yarn build
```

Then, in Google Chrome:

- Open the _Extension Management_ page by navigating to [chrome://extensions](chrome://extensions).
- Enable _Developer Mode_ by clicking the toggle switch next to _Developer mode_.
- Click the _LOAD UNPACKED_ button and select the `browser-sdk/developer-extension/dist/chrome-mv3/` directory.
- Open devtools and the extension features are located on the _Browser SDK_ panel.
Comment on lines +88 to +91
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Open the _Extension Management_ page by navigating to [chrome://extensions](chrome://extensions).
- Enable _Developer Mode_ by clicking the toggle switch next to _Developer mode_.
- Click the _LOAD UNPACKED_ button and select the `browser-sdk/developer-extension/dist/chrome-mv3/` directory.
- Open devtools and the extension features are located on the _Browser SDK_ panel.
1. Open the **Extension Management** page by navigating to [chrome://extensions](chrome://extensions).
2. Enable **Developer Mode** by clicking the toggle switch next to **Developer mode**.
3. Click the **LOAD UNPACKED** button and select the `browser-sdk/developer-extension/dist/chrome-mv3/` directory.
4. Open devtools. The extension features are located on the **Browser SDK** panel.


### Using the dev server

To work on the developer extension and debug it easily:

1. In a terminal, cd into the `developer-extension` folder.

2. Run `yarn dev`.
3. A Chrome browser window with the developer extension loaded opens automatically.
Comment on lines 98 to +99
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Run `yarn dev`.
3. A Chrome browser window with the developer extension loaded opens automatically.
2. Run `yarn dev`. A Chrome browser window with the developer extension loaded opens automatically.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Because the Chrome window opening is not an action the user can take, I've moved it up to the previous step. It's a result of the action taken in this step.)

4. After you make a change, right-click on the extension UI and select **"Reload frame"** to see your updates.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. After you make a change, right-click on the extension UI and select **"Reload frame"** to see your updates.
4. After making a change, right-click the extension UI and select **Reload frame** to see your updates.


3. A Chrome browser window with the developer extension loaded opens.
> **Tip:** If you are running `yarn dev` and want to load the extension into your own Chrome profile, you can load the `dist/chrome-mv3-dev/` folder instead of `dist/chrome-mv3/`. This dev build includes hot reload support.
1 change: 1 addition & 0 deletions developer-extension/wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getBuildEnvValue } from '../scripts/lib/buildEnv'

// eslint-disable-next-line import/no-default-export
export default defineConfig({
outDir: 'dist',
modules: ['@wxt-dev/module-react'],
entrypointsDir: 'src/entrypoints',
manifest: {
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default tseslint.config(
'**/playwright-report',
'docs',
'developer-extension/.wxt',
'developer-extension/.output',
'developer-extension/dist',
],
},

Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/publish-developer-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runMain(async () => {

printLog('Zipping extension files')
const zipPath = path.resolve(ZIP_FILE_NAME)
command`zip -r ${zipPath} .`.withCurrentWorkingDirectory('developer-extension/.output/chrome-mv3').run()
command`zip -r ${zipPath} .`.withCurrentWorkingDirectory('developer-extension/dist/chrome-mv3').run()

printLog('Publish Developer extension')
await uploadAndPublish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path'
import { expect, test } from '@playwright/test'
import { createExtension, createTest } from '../../lib/framework'

const developerExtensionPath = path.join(process.cwd(), 'developer-extension/.output/chrome-mv3')
const developerExtensionPath = path.join(process.cwd(), 'developer-extension/dist/chrome-mv3')

test.describe('developer extension', () => {
createTest('should switch between tabs')
Expand Down