28 Commits
Author SHA1 Message Date
Nikolay Vitkov f591172202 [eslint] Fix extension-api
We need to proved the tsconfig so EsLint can lint correctly

Bug: none
Change-Id: If2ee68deef76e51e4a9096e417e9c6bb01ba7e67
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6407772
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
2025-03-31 02:36:29 -07:00
Nikolay Vitkov afc8a8cec8 [eslint] Include ExtensionAPI
This makes all current files under DevTools lintable with EsLint
by default.
Also remove the rule for default export for configs.

Bug: 397260638
Change-Id: I3b380ad4351eb53c65207b242d7f8221e7788e48
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6357121
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2025-03-17 03:48:33 -07:00
Vidal Guillermo Diazleal Ortega dc49e2d266 Adding attachSourceMapURL to Resource in ExtensionAPI
This CL adds the APIs required for attaching a sourcemap to a resource via Extension APIs.

This CL considers that the External Developer will subscribe to some of
the existing Devtools Extension API (chrome.runtime.onConnect,
port.OnMessage & inspectedWindow.onResourceAdded)

This “subscribed“ extension, will be notified every time a resource is
loaded. This includes images and any other resources

This CL introduces:
 - APIs shape and implementation (attachSourceMapURL)
 - ExtensionServer implementation
 - ExtensionServer tests

Full spec can be found here (Implementation):
https://docs.google.com/document/d/1x9_MTMVr213ApruMK6ryc4JpPHahvOBlExP6sHkMv8Y/edit?pli=1

Bug: 364508694
Change-Id: I35a53b58fae1ba41b733bc4bcb8ed6b8022dad54
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6166854
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2025-02-07 09:55:56 -08:00
Elorm Coch 85e07414a7 Adds Extension API support for sourcemap augmentation with scopes Information
This introduces API support `Resource.setFunctionRangesForScript` that
allows extensions to augment v3 or pasta sourcemaps with OriginalScopes
information for improved debuggability and function naming.

Design Doc:
https://docs.google.com/document/d/15lQHRdCCvfMh_OXrfA5xI45bB1-2hYbLIS2vSjoa5Yg/edit?tab=t.0#heading=h.pfxlybu89pmu

Sample extension Implementation:
https://github.com/ElormCoch/sample-unminification-extension

Bug: 392657731
Change-Id: I9e1607a09a0e35f0a69b73d2efbd6a3b435ccad4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5774044
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sylvester Elorm Coch <elormcoch@microsoft.com>
2025-02-05 09:51:20 -08:00
Andrés Olivares 39a072ca50 [DevTools extensions] Add EventSink::removeListener type
Bug: none
Change-Id: I6f98348034b4eac512bee2e6da095298fd543439
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5604433
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2024-06-10 15:13:17 +00:00
Jérôme Vouillon 32d0a0e32b C++ debugging extension: support type externref
This is implemented by passing a reference to the externref value through the extension (type ForeignObject in the extension API).

A tricky point is that one can only pass numeric values through LLDB, so we pack this reference into a 64-bit integer.

Fixed: 334965862
Change-Id: I6b4644d51ff59eee2c66f034017bc7a924d5febe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5458414
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2024-05-28 07:30:44 +00:00
Kim-Anh Tran f04c1f3f32 Change getFunctionInfo api to also accept missing symbols and frames
Previously there was a mismatch between what DevTools front-end
expected and what the DWARF C/C++ extension would return on
`getFunctionInfo`. The front-end only expected either `frames`
or `missingSymbolFiles` to be sent, but the extension would
return both. Combined with a recent change, this led to unwanted
warning messages on missing symbol files, although no symbol files
were actually missing.

This CL changes the LanguageExtensionPlugin API such that
`getFunctionInfo` may also return both.

Bug: 342316962
Change-Id: I312fd6783052d948ff76c3285a52b3a7c0052763
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5557983
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2024-05-23 09:09:57 +00:00
Andrés Olivares 6a38742498 [RPP] Dispatch onProfilingStarted & onProfilingStarted extension events
Based on the proposal in go/cpq:rpp-extensibility-design

Bug: 40288106
Change-Id: I0d008f87c32318a4ace77cb0ea9ee61178d2638c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5419443
Reviewed-by: Paul Irish <paulirish@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2024-04-08 16:20:37 +00:00
Philip Pfaffe c80bda4ab1 [extensions] Add chrome.devtools.panels.network.show()
This allows chrome.devtools extensions to direct the user to the Network panel, optionally filtering for requests.

Fixed: b:332838909
Change-Id: I159b30dbb485ac7f57e9a8bda22d508b2028a080
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5314341
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2024-04-04 16:00:58 +00:00
Kim-Anh Tran cae650cc8a Report resources loaded through extension to PageResourceLoader
This extends the LanguageExtensions API to include a mechanism
for extensions to report loaded resources. These resources will
be registered by the PageResourceLoader, so that resources
loaded through extensions will also show up in the Developer
Resource Panel.

Also-by: pfaffe@chromium.org
Bug: 40746829
Change-Id: I03d90ac57a9155eeca9e3f16377007735f092ba0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5291295
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2024-02-21 09:29:56 +00:00
Benedikt Meurer 6428bce1a6 Update devtools.inspectedWindow.eval types to match the actual API
The ExtensionServer actually uses scriptExecutionContext from the
option.

R=caseq@chromium.org

Bug: 1275331
Change-Id: Id3bc0bee869488f16b07d6bb1e31bd71a51738a6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3892289
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Owners-Override: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2023-09-15 12:25:25 +00:00
Philip Pfaffe 8a3d59b5ec Remove deprecated experimental language plugin extension API
Fixed: 1342848
Change-Id: Ic1f7ffe626e7668d8dffb413ef30c2bf8c8d718e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4506633
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
2023-05-04 13:59:21 +00:00
Alex Rudenko 0b8b888ec0 [Recorder] Implement Recorder extension API for replay
Chromium documentation: https://crrev.com/c/4161597
Doc: go/devtools-recorder:replay-extensions
Bug: chromium:1400243
Change-Id: I4ab5d6cc7c30a5a9970c5099a8cdff179c2f3722
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4117074
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2023-01-30 09:28:34 +00:00
Philip Pfaffe 913156fb2f Language extension API docs
Add docs for the language extension API.

Drive-by: Fix a comment on the API typings.

Bug: none
Change-Id: I411845a4bff8d1ecbfec41875e998234b8981b80
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4110802
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-12-16 10:33:25 +00:00
Philip Pfaffe 1ae5c9db5d [LMI] enable object highlighting for new extension API
We recently introduced a new API for extensions to access wasm state and
evaluate code and variables. This change makes object highlighting in
the LMI work with that API, which requires extensions to also report
object sizes in addition to addresses, which was previously missing.

Bug: 1336568, 1299832
Change-Id: I63ad2db35237a0944e09e0b9e62ccc2569d39dca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3904643
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2022-09-20 10:54:20 +00:00
Philip Pfaffe 889342a7e9 Mark new wasm extension APIs as optional for the migration path
Bug: 1299832, 1342848
Change-Id: I07f7311ca68b4a8a2ae8e12aef3daaecd396f535
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3751212
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2022-07-08 07:06:36 +00:00
Philip Pfaffe 6ed01266dd Add an extension API to access wasm state
This CL implements an API that provides extensions with access to the
current wasm state (i.e., wasm linear memory, locals, globals, and
operand stack values). For safety, access is guarded by a per-callframe
instance stop id to make sure extensions don't try to access stale
state.

Bug: 1299832
Change-Id: I335ebb5236f10fe31d64feb7f8cbc808f96c304f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3667644
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
2022-07-07 12:27:31 +00:00
Philip Pfaffe ae1192b630 Show warning infobar for missing debug info
For wasm debugging it's possible that debug info is incomplete on a per-callframe granularity. When debug info is incomplete we currently show a warning banner in the call stack sidebar pane and a little warning icon next to the affected callframes. It's too easy to overlook this. With this CL we're introducing a prominently red error infobar directly in the editor when an incomplete callframe is selected.

Bug: 1331281
Screenshot: See crbug.
Change-Id: Id804e087a0f04d8daa9169a77e0e78eb8556e6c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3610169
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Peter Müller <petermueller@chromium.org>
2022-06-02 15:29:00 +00:00
Alex Rudenko 53dbba4ba6 Rename mimeType to mediaType in Extensions API
MIME is an outdated name. See https://www.iana.org/assignments/media-types/media-types.xhtml.

Bug: 1325751
Change-Id: Ic296c787596cc2f11cf56abb5e72c00c668c58e3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3687329
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-06-02 13:36:39 +00:00
Alex Rudenko fba45c59e9 Add mimeType and stringifyStep to Recorder extension API
mimeType would be needed for syntax highlighting and file extension
generation. And stringifyStep for partial stringification.

Bug: 1325751
Change-Id: I2a8c7c55cf5c8ea299a5e133725ce59e6ea69dad
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3683218
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2022-06-01 08:07:38 +00:00
Alex Rudenko a3850828fc Extensions: add Recorder extensions API
This CL adds the extension API for Recorder panel.

Bug: 1325751
Change-Id: Ibe4f13a2fd868530c72eab7562efe9ab33bbddd7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3657448
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2022-05-25 08:25:11 +00:00
Paul Lewis ada689f4f7 Add API to notify extensions on theme change
We recently changed the behavior of DevTools such that it doesn't reload
when the theme changes. However, during instantiation an extension
receives the current theme name under chrome.devtools.panels.themeName.
Given the above, when the theme changes, the themeName value is stale,
and the extension has no way of knowing that the theme has changed.

This CL introduces a new hook for extensions, setThemeChangeHandler,
which follows the same pattern as setOpenResourceHandler. This allows an
extension developer to register a callback for when the theme changes.
The chrome.devtools.panels.themeName is automatically updated, and the
callback also receives the theme name as its parameter.

Bug: 1285420
Change-Id: I52aa813d7d7b327ad6bfe8ca99fa9d578662b417
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3380591
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2022-01-11 13:21:55 +00:00
Tim van der Lippe 269e9ae3eb Replace any in return values for void
This applies the following regex to the codebase:

=> any

and replaces it with

=> void

All obsolete typescript-eslint disable rules have been removed as well.

R=szuend@chromium.org

Bug: 1172300
Change-Id: I98dc2153f539c68853ed4e9cba8503a4b69763ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3338347
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2021-12-14 14:27:48 +00:00
Philip Pfaffe 140e54340d [extensions] Add a columnNumber argument to panels.openResource
chrome.devtools.panels.openResource is an extension API that causes a
page resource to be opened in the sources panel at a given line. For
wasm, though, line numbers are meaningless. Across DevTools, wasm module
offsets are encoded as column numbers. This CL adds a column number to
the openResource API.

Fixed: 1234438
Change-Id: I141ea0cdb10e211d9cdb8bbab0fc994597ddb5a6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3063505
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-09-14 05:24:00 +00:00
Philip Pfaffe 11e43681c0 [extensions] Replace getter with readonly property in interface
Bug: none
Change-Id: I3803e8d2ebfd5b98f33ff42530de95331fb3d0b3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3059611
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-07-29 12:32:37 +00:00
Philip Pfaffe 1e2a371b61 [language extensions] Use extension-api typedefs
This CL removes the remaining duplicates of the langauge extension api
type declarations, and uses the extension-api in their place.

Drive-by: Add an enumerators field to the API.

Bug: none
Change-Id: Ic71871aa0364eb715fa90ab5cc1becf5a43cb9e9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3045353
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2021-07-23 10:37:22 +00:00
Philip Pfaffe 44de218fdd [e2e] Use extension API typedefs in the language plugin tests
Fixed: 1219420
Change-Id: I984ca98ce8e5fb715b67df44e46e9f94553fd2b7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3038643
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-07-20 13:29:01 +00:00
Philip Pfaffe 5df6626235 [ts] ExtensionAPI: Add public extension api typedefs
This change adds typedefs for the public extension API that can be
imported both by the front_end as well as the e2e tests.

Bug: 1219420
Change-Id: I4cde713d167bec0ce3acbe5187f9914b3223e666
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2963825
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-07-19 15:25:40 +00:00