Commit Graph
26 Commits
Author SHA1 Message Date
Adam Raine 9312c5bd24 Add Lighthouse FR Navigation Mode
Puppeteer is a dependency for the new mode. This CL modifies the
`getPuppeteerConnection` function from the recorder panel. The new
version of this function can be shared between the Lighthouse worker
and the recorder panel.

Bug: 1291284
Change-Id: Ie2cc144f5bd27b9970392638f08f968019b039c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3412356
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
Reviewed-by: Randolf Jung <jrandolf@chromium.org>
Commit-Queue: Adam Raine <asraine@chromium.org>
2022-02-10 18:34:21 +00:00
Andres Olivares 7ba4faeabc Adds service to obtain DevTools dimensions
When DevTools is docked, the document containing DevTools spans the
whole content of the browser tab which includes not only DevTools but
also the inspected site. This means that using the bounds of the
`window` or `document.body` objects as DevTools dimensions could be
incorrect.

For this reason, this CL implements a service that can be used to obtain
the effective dimensions of DevTools regardless of its position (docked
or undocked). This is done by accessing the element wrapped by the
InspectorView singleton.

Bug: 1269206
Change-Id: Ia2a1aeb4a28ce0ff1a4d7579ea2f94bd6fff99bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3296082
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-23 13:49:09 +00:00
Tim van der Lippe 2a9f89982e Remove abstraction layers around Lighthouse worker communication
Historically, services and worker_service implemented an abstraction
around communicating across worker/socket boundaries. This implementation
was used for the lighthouse_worker, where the ServiceManager.js
would send message to the worker and ServiceDispatcher.js would
receive these messages.

However, these abstractions were not used anywhere else and were very
difficult to follow. Ultimately, the abstractions were a basic interaction
on top of worker.postMessage. Therefore, we can clean up these abstractions
in favor of a simpler more direct approach with postMessage.

Along the way, we have added clarifying comments as to what the
code is doing and made some readability cleanups to the various
methods and fields of the classes involved.

R=jacktfranklin@chromium.org

Also-By: jacktfranklin@chromium.org
Bug: 1015330
Change-Id: I8edcef9a5c8c3794a695b91a77af8135164b7ed6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2697187
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-02-17 16:21:09 +00:00
Tim van der Lippe 51fe0c80be Remove services/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: I6a8fc6dc18d9ec8927120b59591f2258f2ea620c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2686662
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-10 15:46:45 +00:00
Tim van der Lippe 79e4d8531a Remove host/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: I3015c907604c739ee3d50a003f47faa6861215ea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676145
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-05 10:55:28 +00:00
Tim van der Lippe 49f2cf1f4e Remove common/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: Ie7556606b481d34e32fc46f684fa21fc04e1bd2d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676143
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-05 10:44:28 +00:00
Tim van der Lippe d7cfd14814 Fix no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

No-Presubmit: True
Bug: 1082789
Change-Id: Ic77884bf7e9b5dc74053915b3b10699368841b66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595268
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 12:40:16 +00:00
Tim van der Lippe e4d64e7ae0 Remove unrestricted from comments that include other annotations
For all comments that contained both the unrestricted annotation
and any other potential annotation, remove only the unrestricted
annotation.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: I27dd67f657cdb1a9233d768eea81cabe2591f5f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569759
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-02 15:31:52 +00:00
Tim van der Lippe 2e38eeaf9f Remove all comments with only the unrestricted annotation
The unrestricted annotation is Closure-specific and can be removed.
This patch removes all comments with only the unrestricted annotation
in them.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Iba0723644f53f5307c3077d341271af86becc32a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569758
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-02 15:25:32 +00:00
Tim van der Lippe 46e1bcace9 Remove pre_generates_legacy from module.json files
This was a temporary flag used during the build_release_applications
to GN migration.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: I8a772bcc4bee31dbd3270bf7ef62d8c97941024a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484716
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-19 16:12:09 +00:00
Tim van der Lippe 8a408c1be4 Move legacy files from core modules to GN
R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ic61ee8b06fc5c6cfbc41682aebbdc232e91e556e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2476333
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-16 10:50:32 +00:00
Tim van der Lippe cac65d4fa0 Remove skip_rollup
This was a temporary flag as part of the devtools_entrypoint migration.
Since that migration has concluded, we can now remove all references
to it and clean up `build_release_applications.py`.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

Bug: 1101738
Change-Id: I3ef9ec1a99bc9fc1758532124db22b3b4b1a5e2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391140
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-08 15:44:09 +00:00
Tim van der Lippe 19a45dfd55 Remove is_legacy_javascript_entrypoint
This removes the now-obsolete is_legacy_javascript_entrypoint build flag,
which was used as part of the devtools_entrypoint migration.

This uncovered that accessibility was still using devtools_pre_built
and a file was missing from the GRD variable.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Fixed: 1101738
Change-Id: Ie1556ccc1d1563c855417de18e896308de0cfe19
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2356305
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-28 12:32:29 +00:00
Tim van der Lippe c7cd1aa1af Typecheck services/ServiceManager.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I5c1e6c5e76b00c0f0102f77dcf6045905a5cd8a5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2379691
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-27 12:27:55 +00:00
Jan Scheffler 0126f0e87f Migrate front_end/services to devtools_entrypoint
Bug: 1101738
Change-Id: I0d2ba376d3acc6a3e482d40f06bc7e3eb6721842
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318227
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-28 15:36:12 +00:00
Tim van der Lippe 37512b0d25 Remove empty script arrays from module.json files
If the module uses `modules` to load the JavaScript files, then
we can remove the `scripts` array altogether. Note that there
are still some modules left that use `scripts`, most notably
the `lighthouse_worker`, which is a remote module.

R=aerotwist@chromium.org

Bug: 1105476
Change-Id: Ie303e9835f5ce6d42ccae7b3a305d8f3df1af84c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302597
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-17 10:05:33 +00:00
Patrick Brosset e65aaac861 Enable the no-return-assign ESLint rule
This rule disallows assigning a value in a return statement.
It also works in one-liner arrow functions.

For instance, a => a = 2 will trigger a warning.
This is to avoid cases where you actually meant to compare a to 2, not
assign the value 2 (maybe you wanted to return a boolean in a filter
callback).
These sorts of issues can easily pass review and cause weird problems
that are hard to track down later.

The rule is enabled in this CL, and all warnings are fixed with this CL.

More info about the rule: https://eslint.org/docs/rules/no-return-assign

Bug: 1093379
Change-Id: I38b98ea59ecaedc83a7f69073b17980808f9a3bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2242761
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-06-22 08:34:42 +00:00
Mathias Bynens 5e43b27e8b Reformat module.json files
This patch makes it so that all module.json files use the same
consistent indentation that matches .editorconfig and the rest
of the codebase. At the request of reviewers, one such file
(front_end/emulated_devices/module.json) has been excluded
from this patch. It will be reformatted in a separate CL.

Note that this patch does not “roll CodeMirror”, although a
pre-commit hook forces me to include that phrase in the commit
message because the module.json file in the relevant folder is
modified.

Bug: chromium:1070492
Change-Id: Ib31ed5232461e2f80bf05f31105fc919f6639b0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2127007
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-14 05:35:23 +00:00
Tim van der Lippe 5772b82a6e Make audits_worker a worker with module scope
This allows us to properly import the Runtime with an ES import, as well
as resolve the service dispatcher in the appropriate scope. It relies on
the previous patch to be pushed to the appspot server, before it can be
resolved properly.

Bug: 1006759
Change-Id: I2d65c82e00ffaaa6ca2dd39fd4309e44d7a87002
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2030781
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-03 12:46:28 +00:00
Tim van der Lippe 4bc6e7007a Migrate services/ to import cross-module
Bug: 1006759
Change-Id: Ic98fb2323855b6c7acf09a13e4aeb55c8d5290db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016758
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-23 14:17:50 +00:00
Paul Lewis 135a78d67a Migrates services/ to ESM internally
R=tvanderlippe@chromium.org

Bug: 1006759
Change-Id: I351f94047d536fb3a080cfaec000f96a5221b622
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2002593
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-16 10:29:35 +00:00
Tim van der Lippe c96ccd99f0 Remove unused globals
By using the script in crrev.com/c/devtools/devtools-frontend/+/1942289
we can prune all globals that are not actually global. Most of these are
internal private variables that are now module-scoped. Some variables
were also completely unused, which ESLint nicely reported.

Change-Id: I43689ac7544ad1239acc7d0eeec4dcd563d7fea9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942290
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-29 16:38:40 +00:00
Tim van der Lippe 4d703237a9 Migrate services/ to ESM
Bug: 1006759
Change-Id: I17818dd46ad42882388a145cdd49400f2f2e5a7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845711
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703691}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e92249105abf8f8572a5ab5acd3fc6fa3f6c18f7
2019-10-08 14:28:24 +00:00
Tim van der Lippe 99e59b8c29 Migrate Runtime.js to ESM
Introduce a new namespace "Root" to be able to disambiguate between
Runtime the namespace and Runtime the object.

roll CodeMirror
The above line is necessary to fix the presubmit, which complains
about CodeMirror changes. This is only updating a type reference.

Bug: 1006759
Change-Id: I04941d9f18649701060e3035f7eeb2ef3abb51e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829708
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17cc008cf6ad28c6e8c07c638a1b380ca30e7f79
2019-09-30 20:00:59 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00