To prevent duplicates amongst legacy and pre-registered views and
actions a check is implemented in the place where both legacy and new
extensions of registered in the same data structure and an error is
thrown in the case of duplicates. Note that this check had been
implemented already for setting extensions.
This is only to keep support for both the legacy and new extension
registration systems during the migration. Because a check for
duplicates already exists for extensions registered with the new system,
checks added in this CL will be deleted once all extensions have been
migrated and the legacy system has been completely removed.
Bug: 1134103
Change-Id: I3601dffe64cd2ccfb7c16e3ad10bdc0cb103b189
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2607298
Auto-Submit: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
When providing the details for a request in the performance panel, we
calculate the network duration based on the request's finish time minus
its start time. However for data URLs there is no request finish time
since these never go out to the network, which results in a negative
time shown as the code defaults the finish time to zero (0).
This CL updates the code to default the finish time to be the start
time in the event that no finish time exists or if it is zero(0).
Bug: 1157396
Change-Id: I04b03fdeb7941009e88707df44ec68ef9e2f0fda
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2627269
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Previously we relied on the debuggerModel to create a raw location,
which is used for creating live locations.
This changes raw locations (DebuggerWorkspaceBinding.Location)
to rely on scriptIds instead of scripts. As a result we can create a
live location even if we currently do not have a script.
As soon as the debugger is enabled and a script is parsed, the
live locations will be updated with the relevant information.
We use this change in the Linkifier, which now shows no link if
the debugger is disabled (e.g. if we profile), and updates the
location and shows the link as soon as the debugger is enabled.
Also-by: bmeurer@chromium.org
Also-by: pfaffe@chromium.org
Bug: chromium:1132260
Change-Id: I48dc6016099d5b82d702a4331f93301693a6a6f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595386
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
This CL addresses an issue where datagrids could unexpectedly announce
content to screen readers if a grid node is selected when the grid
does not have focus - which can occur when a grid is first created.
This change limits datagrid alerts to when the grid has focus.
Repro steps in bug description.
Bug: 1164034
Change-Id: Ib6fd7012782f7073617ed20d5432333d83732ccb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2618379
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
Uses the new script to generate the dark mode styles for cmdevtools so save us
manually processing it. Tested by clicking around the sources panel in light and
dark mode and verifying that things look as expected.
Also fixed some bugs in the generator script to ensure we generate the
right selectors.
Bug: 1152736
Change-Id: If3491651be116033be7248e695ceab1de5f3fc5c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593129
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
The inspector-stylesheet is a special virtual file that is used
to keep track of any new CSS rules, which can be added by clicking
the "New Style Rule" button in the Elements panel. However, the
changes computation broke and was no longer showing any changes
to this file.
The most likely culprit is https://crrev.com/c/2378070 which changed
the way errors were handled. The TLDR is that the `baseline` became
an empty string, which is falsy. Hence, the diff computation bailed
and was not showing any diffs.
Instead, we should be explicitly checking of the `baseline` is `null`,
since it is legal to perform a diff computation between an empty
string and a larger string.
R=szuend@chromium.org
Fixed: 1152507
Change-Id: I1aa778e7922586a4381cbc1e1e6e543a5ccffdd9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2610964
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
This TODO is not required any more; the source files do declare a dep on
the UI Components folder which house the icon.
The associated bug should remain open as there is more work to do to
make declaring component dependencies easier (LitHtml 2 should help
here).
Change-Id: I9375e2dc8dbd781be86522daaa3023699942e52b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2617788
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Also adds test `lighthouse-block-url.js`, which passes
even without this change. I wanted confidence that any
future refactor here will retain the benefits of multi-client.
In short: DevTools is sending the "same" messages to Lighthouse
for the root session: one without a session id (good, expected, LH and
DT assumes this means it comes from the main target), and one also
for the main target but with an explicit sessionId (bad, we end
up double-processing things). This is an overlooked side effect of the
"multi client" work:
- https://chromium-review.googlesource.com/c/chromium/src/+/1743411
- https://chromium-review.googlesource.com/c/chromium/src/+/1838310
This CL is a rather narrow change, but it's important as we are
currently double-counting the size of most requests, which
is a big problem for accuracy. There are likely issues with other domains
sending multiple events. A more involved fix will require a closer
look at the protocol connection juggling going on here.
See https://github.com/GoogleChrome/lighthouse/issues/11415
Change-Id: Ife7296dbd08153784ef700e761d529ffe4b39272
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2607769
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Connor Clark <cjamcl@chromium.org>
The LocalizedString type alias in UIString.js is a so-called
"branded type". A branded type alias allows us to construct
special types in type-casts and enforce that these specific
alias are used. The following properties hold:
1. A string can be force-casted into a LocalizedString
2. A LocalizedString can be enforced as argument type
3. A LocalizedString can be downcasted/used as regular string
4. A LocalizedString can normally not be concatenated, unless
force-casts are added (which is strongly discouraged, since
localization can be structure-dependent)
These properties are for example used to enforce that all titles
of the ViewRegistration declarations are localized strings. I have
manually verified that passing in a regular string will correctly
cause TypeScript to error.
The new i18n localization system uses the same force-cast to make
sure that the new localized strings also adhere to the same
structure.
As a result of this change, I discovered several inconsistencies
in how types were used. For example, strings were being passed
in and assumed to be localized, but not enforced. Therefore,
this CL contains several cleanups that require the LocalizedString
itself and hence have to be bundled in this CL.
R=petermarshall@chromium.org
Change-Id: I2faffde47069c900e2e5e7c0ebb460d0792d2935
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612861
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>