Commit Graph
87 Commits
Author SHA1 Message Date
Gregory Pappas 5e942dde11 Bug 1546738 - Get rid of the hidden window usage to get a WebSocket object r=ochameau,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D219620
2024-08-21 20:07:14 +00:00
Alexandre Poirot 5eeea2b7d6 Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

The Worker Target URL is now correctly set to the Absolute URL,
this has an impact on the context selector as we are displaying it.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-27 09:53:55 +00:00
Cristian Tuns d0272b92b7 Backed out 8 changesets (bug 1651518, bug 1883847) dt failures in nsTArray.h. CLOSED TREE
Backed out changeset 481558275c1d (bug 1651518)
Backed out changeset 5337435e8bca (bug 1651518)
Backed out changeset 8fe0c1a4da7f (bug 1651518)
Backed out changeset 840a0d9db260 (bug 1651518)
Backed out changeset eaab9de5819d (bug 1651518)
Backed out changeset cf71de92d782 (bug 1651518)
Backed out changeset d778691464db (bug 1651518)
Backed out changeset af28e5f719e8 (bug 1883847)
2024-05-22 09:02:19 -04:00
Alexandre Poirot 76d52e829a Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

The Worker Target URL is now correctly set to the Absolute URL,
this has an impact on the context selector as we are displaying it.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-22 11:50:45 +00:00
Cristina Horotan ca70119cfa Backed out 8 changesets (bug 1651518, bug 1883847) for causing damp failures at toolbox/browser-toolbox.js CLOSED TREE
Backed out changeset 4ec70db12f48 (bug 1651518)
Backed out changeset b2b138889ad6 (bug 1651518)
Backed out changeset efda5c09b0ea (bug 1651518)
Backed out changeset b0de4113f8fb (bug 1651518)
Backed out changeset 03cf235d2a80 (bug 1651518)
Backed out changeset 58e71c27f1fd (bug 1651518)
Backed out changeset f7fb390c3965 (bug 1651518)
Backed out changeset b8a2473c47c0 (bug 1883847)
2024-05-22 04:00:53 +03:00
Alexandre Poirot 64b2f242bc Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-21 14:09:35 +00:00
Nicolas Chevobbe 8609258f9f Bug 1887638 - [devtools] Add InspectorCSSParser. r=emilio,devtools-reviewers,frontend-codestyle-reviewers,bomsy.
This new InspectorCSSParser makes use of the cssparser crate so DevTools end
up using the same code as the CSS engine.
At the moment, we can't get the token start and end offsets, so we create
a JS wrapper class to compute them in JS. This might be removed if we get
a way to retrieve utf16 position from the cssparser.
The existing lexer xpcshell test is modified so it can run against both js-based
and rust-based lexers.

Differential Revision: https://phabricator.services.mozilla.com/D202909
2024-04-15 17:14:42 +00:00
Mark Banner d79c6960e4 Bug 1889087 - Enable ESLint rule mozilla/reject-chromeutils-import on devtools as well. r=arai,devtools-reviewers,profiler-reviewers,julienw,frontend-codestyle-reviewers,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D206349
2024-04-06 09:08:47 +00:00
Sandor Molnar 890280e412 Backed out changeset 50f86f169ee8 (bug 1889087) for causing talos performance test failures CLOSED TREE 2024-04-03 09:18:07 +03:00
Mark Banner 8b11d372f2 Bug 1889087 - Enable ESLint rule mozilla/reject-chromeutils-import on devtools as well. r=arai,devtools-reviewers,profiler-reviewers,julienw
Differential Revision: https://phabricator.services.mozilla.com/D206349
2024-04-02 19:05:48 +00:00
Alexandre Poirot d7f3cddc7f Bug 1888171 - [devtools] Convert Browser Loader to ESM. r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D205867
2024-03-28 15:15:24 +00:00
Alexandre Poirot f74f2467f4 Bug 1888171 - [devtools] Convert worker loader module to ESM. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205865
2024-03-28 15:15:22 +00:00
Alexandre Poirot c867832007 Bug 1789981 - [devtools] Convert last DevTools JSM to ESM. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202438
2024-03-26 08:29:22 +00:00
Nicolas Chevobbe 180b6d0800 Bug 1862896 - Expose CustomStateSet in DevTools sandbox. r=smaug,devtools-reviewers,ochameau.
This will be used in next patch to customize rendering of CustomStateSet in DevTools.

Differential Revision: https://phabricator.services.mozilla.com/D204596
2024-03-15 06:05:17 +00:00
Mark Banner 0645e16c6c Bug 1884619 - Remove worker-loader.js reference to removed Promise-backend.js. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D204179
2024-03-11 10:11:35 +00:00
Tooru Fujisawa 571e7ae7b8 Bug 1875639 - Part 2: Explicitly use contextual loader in files loaded into DevTools global. r=ochameau,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D199467
2024-02-20 04:49:57 +00:00
Tooru Fujisawa 0791e8d3c4 Bug 1875639 - Part 1: Use global option instead of loadInDevToolsLoader option. r=ochameau,devtools-reviewers
global option supercedes loadInDevToolsLoader, with omitting the
implicit contextual loader behavior.
In order to make the API less error-prone, use global option, with requireing
global option in DevTools global, to choose from shared global or explicit
contextual loader.

Differential Revision: https://phabricator.services.mozilla.com/D199466
2024-02-20 04:49:57 +00:00
Mark Banner 40de601f11 Bug 1834176 - Convert consumers of NetUtil.jsm to import the ES module directly. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
2023-06-07 08:42:36 +00:00
Natalia Csoregi 1b67d0b941 Backed out 3 changesets (bug 1834222, bug 1834176) for causing RemoteProcessMonitor failures. CLOSED TREE
Backed out changeset 346d3a1568dd (bug 1834222)
Backed out changeset ea1d8b634bfc (bug 1834176)
Backed out changeset 74d1880272d3 (bug 1834176)
2023-05-24 04:29:45 +03:00
Mark Banner d1fc869252 Bug 1834176 - Convert NetUtil.jsm to be an ES system module. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
2023-05-23 19:09:29 +00:00
Noemi Erli 1f146f097e Backed out 2 changesets (bug 1834176) for causing xpc failures in test_unload.js CLOSED TREE
Backed out changeset 57876d77a652 (bug 1834176)
Backed out changeset ae2f0837b528 (bug 1834176)
2023-05-23 12:14:37 +03:00
Mark Banner 08ff6c0ad9 Bug 1834176 - Convert NetUtil.jsm to be an ES system module. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
2023-05-23 08:13:08 +00:00
Mark Banner 0666077666 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner 91fde42f7b Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Barret Rennie a80ed65f91 Bug 1817036 - Remove osfile.jsm and ospath.jsm usage from devtools/ r=ochameau
The implementation of base-loader operates on stringly-typed URIs with path
methods. Refactoring this module to use paths and URIs is beyond the scope of
removing OS.File, so the methods from ospath_unix.jsm have been copied into the
module.

Differential Revision: https://phabricator.services.mozilla.com/D170107
2023-02-22 18:15:40 +00:00
Julian Descottes f1a3dac261 Bug 1811138 - [devtools] Remove require calls to InspectorUtils r=ochameau,perftest-reviewers,sparky
Depends on D167211

Differential Revision: https://phabricator.services.mozilla.com/D167308
2023-02-06 09:47:18 +00:00
Alexandre Poirot 27a1221161 Bug 1812646 - [devtools] Convert base-loader JSM to ESM. r=devtools-reviewers,jdescottes
Having it be a JSM make it so that part of the loader is still using the
shared loader global, which can cause various troubles in the browser toolbox.

Differential Revision: https://phabricator.services.mozilla.com/D167962
2023-01-31 13:46:48 +00:00
Alexandre Poirot 07efa6dcf4 Bug 1808797 - [devtools] Add assertion to verify gDevTools is loaded only once. r=jdescottes
The modification made to Loader isn't necessary as the sandboxName
isn't relevant/used. The global will be the one crafted by C++
and be named "Devtools global".
But in case something change, this may catch yet another unexpected behavior.

Differential Revision: https://phabricator.services.mozilla.com/D166122
2023-01-20 09:41:03 +00:00
Iulian Moraru e847342c5e Backed out changeset 184e7ccf3c01 (bug 1808797) for causing multiple failures. CLOSED TREE 2023-01-16 17:44:14 +02:00
Alexandre Poirot d0e5f1de0b Bug 1808797 - [devtools] Add assertion to verify gDevTools is loaded only once. r=jdescottes
The modification made to Loader isn't necessary as the sandboxName
isn't relevant/used. The global will be the one crafted by C++
and be named "Devtools global".
But in case something change, this may catch yet another unexpected behavior.

Differential Revision: https://phabricator.services.mozilla.com/D166122
2023-01-16 14:04:54 +00:00
Alexandre Poirot bf518e5f11 Bug 1805378 - [devtools] Make the SourceMapLoader be instantiated per toolbox. r=bomsy,perftest-reviewers,kshampur
This complexify the existing tests a bit, but will make the management from the Toolbox more obvious.

The metrics test highlights that we allow to prevent loading the sourcemap modules
unless it is strictly necessary!

(Also I forgot to remove the source-map-loader from the list of browser loader module...)

Differential Revision: https://phabricator.services.mozilla.com/D164694
2022-12-20 19:09:57 +00:00
Stanca Serban a07226cd80 Backed out 7 changesets (bug 1805378) for causing failures in source-map-loader.js. CLOSED TREE
Backed out changeset 4dd1ad435728 (bug 1805378)
Backed out changeset 5479ff3a475f (bug 1805378)
Backed out changeset bd89280bde1a (bug 1805378)
Backed out changeset 1bd4fec4b964 (bug 1805378)
Backed out changeset 975bd01106d7 (bug 1805378)
Backed out changeset 9a1e0541748a (bug 1805378)
Backed out changeset 926ce2f2d51f (bug 1805378)
2022-12-19 23:29:20 +02:00
Alexandre Poirot cf1aba2a05 Bug 1805378 - [devtools] Make the SourceMapLoader be instantiated per toolbox. r=bomsy
This complexify the existing tests a bit, but will make the management from the Toolbox more obvious.

The metrics test highlights that we allow to prevent loading the sourcemap modules
unless it is strictly necessary!

(Also I forgot to remove the source-map-loader from the list of browser loader module...)

Differential Revision: https://phabricator.services.mozilla.com/D164694
2022-12-19 17:00:37 +00:00
Alexandre Poirot df719160ef Bug 1801695 - [devtools] Use regular devtools loader to load SourceMap modules. r=bomsy
Now that source-map-loader uses ChromeLoader, it doesn't need to be loaded
via the Browser Loader. It was mostly used to be able to access window.Worker symbol.

It was also exposing `fetch` global symbol. DevTools Loader wasn't exposing it.
I fixed that as this symbol is available in JSM/ESM.

Differential Revision: https://phabricator.services.mozilla.com/D162966
2022-12-12 13:15:52 +00:00
Alexandre Poirot 8c00f1d413 Bug 1794693 - [devtools] Move devtools-source-map to regular mozilla-central code. r=bomsy,perftest-reviewers,jdescottes,sparky
This used to be a node package. Let's make it become regular commonjs devtools modules.
This will make it trivial to migrate this to ES Modules.
Also possibly make this code become the unique layer in m-c on top of the source-map package.

We no longer use webpack to build the two bundles (index.js and worker.js),
instead, we are using the toolkit worker loader (require.js) in order to load
all this code without any build step.

As this is no longer a node package, I removed node-specific modules (assertRoot/wasmAsset)
and simplify the definition of wasm file URIs as they are now fixed.

Also moving the debugger to load internal "devtools/client/shared/source-map/source-map.js"
module in jest as running the Web Worker instantiated by source-map/index.js is too complex.

Differential Revision: https://phabricator.services.mozilla.com/D159115
2022-11-08 16:01:01 +00:00
nchevobbe f72b2b118a Bug 1797021 - Expose MIDIInputMap/MIDIOutputMap in devtools sandbox. r=smaug,gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D160238
2022-11-04 08:49:02 +00:00
Julian Descottes e1a7f602ec Bug 1796582 - [devtools] Load DistinctSystemPrincipalLoader in the dedicated DevToolsLoader global r=ochameau
Depends on D160215

Differential Revision: https://phabricator.services.mozilla.com/D160216
2022-10-28 08:06:38 +00:00
Julian Descottes 05e646b612 Bug 1796582 - [devtools] Extract helpers for distinctSystemPrincipalLoader to a dedicated module r=ochameau
Depends on D160214

Differential Revision: https://phabricator.services.mozilla.com/D160215
2022-10-28 08:06:38 +00:00
Stanca Serban 9c70023e79 Backed out 3 changesets (bug 1796582) for causing failures in test_invisible_loader.js. CLOSED TREE
Backed out changeset a365a7834657 (bug 1796582)
Backed out changeset fa0ff274795f (bug 1796582)
Backed out changeset 70af32ef6986 (bug 1796582)
2022-10-28 10:01:09 +03:00
Julian Descottes 303142285d Bug 1796582 - [devtools] Load DistinctSystemPrincipalLoader in the dedicated DevToolsLoader global r=ochameau
Depends on D160215

Differential Revision: https://phabricator.services.mozilla.com/D160216
2022-10-28 06:23:53 +00:00
Julian Descottes 148f62f92b Bug 1796582 - [devtools] Extract helpers for distinctSystemPrincipalLoader to a dedicated module r=ochameau
Depends on D160214

Differential Revision: https://phabricator.services.mozilla.com/D160215
2022-10-28 06:23:53 +00:00
Mark Banner 5407bdffa8 Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Julian Descottes 1edbb4626c Bug 1788762 - [devtools] Load the NetworkObserver modules in DevToolsLoader if invisibleToDebugger is set r=ochameau
Depends on D156989

Differential Revision: https://phabricator.services.mozilla.com/D159219
2022-10-17 19:56:19 +00:00
Alexandre Poirot 71cb42360b Bug 1793604 - [devtools] Inject JSM/ESM globals directly from Loader.jsm/sys.mjs. r=jdescottes
ESM can't be loaded while loading.
So that Loader.jsm/sys.mjs can't load builtin-modules.js with itself loading Loader.jsm/sys.mjs.
We do that in order to inject JSM/ESM globals from builtin-modules.js.
Let's instead inject the few globals of JSM/ESM directly from Loader.

This isn't ideal, but as Loader is meant to be removed when moving to ESM...

Differential Revision: https://phabricator.services.mozilla.com/D158583
2022-10-14 12:19:42 +00:00
Alexandre Poirot bde84f5b65 Bug 1793604 - [devtools] Convert Loader.jsm to ESM. r=perftest-reviewers,geckoview-reviewers,preferences-reviewers,owlish,kshampur,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158582
2022-10-14 12:19:42 +00:00
Alexandre Poirot 45c25f1d1f Bug 1793760 - [devtools] Remove custom mappings for react modules. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158666
2022-10-10 11:45:00 +00:00
Alexandre Poirot a3b72117bf Bug 1793575 - [devtools] Convert jsdebugger.jsm to jsdebugger.sys.mjs. r=Honza,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D158571
2022-10-06 14:21:22 +00:00
Alexandre Poirot 10e0686cec Bug 1793573 - [devtools] Convert loader-plugin-raw.jsm to loader-plugin-raw.sys.mjs. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158574
2022-10-05 16:07:26 +00:00
Alexandre Poirot 59fe57c052 Bug 1793396 - [devtools] Use absolute URLs in all usages of loader.lazyRequireGetter. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158489
2022-10-03 18:57:13 +00:00
Alexandre Poirot 450d14d375 Bug 1793395 - [devtools] Use absolute URLs for all custom loader's require. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158488
2022-10-03 18:57:12 +00:00