Commit Graph
638 Commits
Author SHA1 Message Date
Alexandre Poirot 26d9f9bb91 Bug 1713093 - [devtools] Remove TargetMixin.attachThread. r=devtools-reviewers,nchevobbe
This code was only used for workers targets, which weren't passing breakpoints
from the server side via "sessionData" concept.
Instead, we were still relying on the frontend to pass them and only after that
manually requesting the thread to resume its execution.

Now, there is still a notion of "attach" around the thread actor.
While all the targets are immediately instantiating their related thread actor,
the thread actor isn't active by default.
It becomes active as soon as:
* SOURCE or THREAD_STATE resource is watched
* breakpoints are set via session data (breakpoint list actor)
* thread configuration are set via session data (thread configuration actor)
I had to do one of these things in order to keep test from working.
In the production code, we do most of these things by default on the toolbox startup.
We could revise this behavior by:
* always attaching the thread actor, but it may start pausing unexpectedly in some tests.
* decouple sources from breakpoints within the thread actor, so that watching for sources doesn't necessarily "attach" the thread actor and activate breakpoints/debugger statements.
* have a new thread configuration to explicitly enable the thread actor pausing features.

I'm often using thread configuration to enable pausing in tests.
This required to improve xpcshell test helpers to be able to use Watcher/Commands.

About browser_target_command_bfcache.js, the DevTools code is now so quick that the
back/forward requests at done too quickly one after the other and fail actually moving to
the other document.

Differential Revision: https://phabricator.services.mozilla.com/D166321
2024-03-20 12:30:17 +00:00
Nicolas Chevobbe adffa997c1 Bug 1698260 - [devtools] Fix autocomplete for Infinity. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D204478
2024-03-15 05:59:56 +00:00
pstanciu 5a1a45a9a8 Backed out 6 changesets (bug 1713093, bug 1691986) for turning Bug 1767717 into permafail. CLOSED TREE
Backed out changeset b0285f8abf2e (bug 1713093)
Backed out changeset 6532dbabf879 (bug 1713093)
Backed out changeset 2670f26f6bff (bug 1713093)
Backed out changeset a63d603a1973 (bug 1713093)
Backed out changeset 0118d0bc64ba (bug 1713093)
Backed out changeset e29a81bc7299 (bug 1691986)
2024-03-08 20:32:38 +02:00
Alexandre Poirot 9f0c59245f Bug 1713093 - [devtools] Remove TargetMixin.attachThread. r=devtools-reviewers,nchevobbe
This code was only used for workers targets, which weren't passing breakpoints
from the server side via "sessionData" concept.
Instead, we were still relying on the frontend to pass them and only after that
manually requesting the thread to resume its execution.

Now, there is still a notion of "attach" around the thread actor.
While all the targets are immediately instantiating their related thread actor,
the thread actor isn't active by default.
It becomes active as soon as:
* SOURCE or THREAD_STATE resource is watched
* breakpoints are set via session data (breakpoint list actor)
* thread configuration are set via session data (thread configuration actor)
I had to do one of these things in order to keep test from working.
In the production code, we do most of these things by default on the toolbox startup.
We could revise this behavior by:
* always attaching the thread actor, but it may start pausing unexpectedly in some tests.
* decouple sources from breakpoints within the thread actor, so that watching for sources doesn't necessarily "attach" the thread actor and activate breakpoints/debugger statements.
* have a new thread configuration to explicitly enable the thread actor pausing features.

I'm often using thread configuration to enable pausing in tests.
This required to improve xpcshell test helpers to be able to use Watcher/Commands.

About browser_target_command_bfcache.js, the DevTools code is now so quick that the
back/forward requests at done too quickly one after the other and fail actually moving to
the other document.

Differential Revision: https://phabricator.services.mozilla.com/D166321
2024-03-06 13:43:48 +00:00
Dave Townsend 2af4d349f3 Bug 1864896: Autofix unused function arguments (devtools). r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D202959
2024-03-05 14:21:15 +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
Gijs Kruitbosch 3288f177a4 Bug 1780071 - autofix devtools/ violations of no-comparison-or-assignment-inside-ok r=profiler-reviewers,devtools-reviewers,julienw,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D198975
2024-01-26 13:12:07 +00:00
Nicolas Chevobbe 5a608228ab Bug 1872689 - [devtools] Prepare codebase for eslint-plugin-react update. r=devtools-reviewers,ochameau.
Updating eslint-plugin-react to 7.33.2 raises new eslint errors.
A few component needed to have their proptypes fixed (or added).
JSPropertyProvider was considered as a react component by the plugin,
I guess because it is a function starting with an uppercase letter.
Since it is a bit unusual to have such thing, I renamed it slightly
to make it look more like a function.

Differential Revision: https://phabricator.services.mozilla.com/D197596
2024-01-04 16:06:08 +00:00
Alexandre Poirot faf55b5e07 Bug 1616524 - [devtools] Allow side effect free console commands to be called in eager evaluation. r=devtools-reviewers,nchevobbe
For now, only console command values like $0, $_ and $x were allowed in eager evaluation,
only by luck as these commands were evaluated and cached *before* Frame.evalWithBinding and Object.executeInGlobalWithBindings
started running the console input string.

But methods were cancelled by onNativeCall. This new isSideEffectFree flag allows to identify these methods.

Differential Revision: https://phabricator.services.mozilla.com/D195022
2023-12-02 08:07:15 +00:00
Alexandre Poirot f47ac5b3fe Bug 1830915 - [devtools] Introduce a generic mechanism to print web console command usage. r=devtools-reviewers,nchevobbe,flod,fluent-reviewers
We can start printing usage description right into the console by using `:command --help` or `:command --usage`.

I also simplified the integration between eval-with-debugger and manager
in order to fully delegate command execution to the manager.

Also improved the jsdoc for the register method. This new feature will be covered by test in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D193272
2023-11-24 14:02:16 +00:00
Joel Maher cac31d18e3 Bug 1859873 - batch 13 xpcshell.ini -> .toml. r=aryx,devtools-reviewers,profiler-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D194161
2023-11-21 12:32:50 +00:00
Alexandre Poirot 1955b12acf Bug 1863512 - Disable tests using SharedArrayBuffer on release/beta. r=devtools-reviewers,nchevobbe
SharedArrayBuffer can only easily be testing through dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled
preference which is locked on beta and release channels.

Differential Revision: https://phabricator.services.mozilla.com/D192942
2023-11-08 17:33:54 +00:00
Alexandre Poirot dbc1747b07 Bug 1860888 - [devtools] Fix logging SharedArrayBuffer from Worklet/Workers. r=devtools-reviewers,smaug
This custom CloneDataPolicy was already using while writing the structured clone,
but not when reading it.

Differential Revision: https://phabricator.services.mozilla.com/D191783
2023-11-06 14:42:52 +00:00
Stanca Serban 9c3f5b4c85 Backed out changeset 4492a1a7f6e7 (bug 1860888) for causing mochitests failures in test_console_serviceworker_cached.html. CLOSED TREE 2023-11-03 12:46:25 +02:00
Alexandre Poirot 0385bcb81d Bug 1860888 - [devtools] Fix logging SharedArrayBuffer from Worklet/Workers. r=devtools-reviewers,smaug
This custom CloneDataPolicy was already using while writing the structured clone,
but not when reading it.

Differential Revision: https://phabricator.services.mozilla.com/D191783
2023-11-03 09:39:41 +00:00
Tom Marble 6c1231e2e8 Bug 1853244 - convert .ini manifests to .toml: batch 6 {caps,devtools,dom}/**/browser.ini r=jmaher,media-playback-reviewers,devtools-reviewers,profiler-reviewers,alwu,nchevobbe,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D188856
2023-09-22 20:42:14 +00:00
Tom Marble d70780c99c Bug 1850545 - convert .ini manifests to .toml: batch 3 chrome.ini (bis) r=jmaher,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,places-reviewers,profiler-reviewers,m_kato,mak,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D187597
2023-09-13 18:28:32 +00:00
Cristina Horotan 71070aa087 Bug 1841281 - enable test_basics.html a=test-only 2023-07-28 15:23:47 +03:00
Cristina Horotan e6fb06e633 Bug 1841281 - disable test_basics.html on win and linux debug for frequent failures. r=aryx DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D184799
2023-07-28 09:39:59 +00:00
Tooru Fujisawa 0d747520b8 Bug 1843795 - Part 1: Rewrite netwerk/base/NetUtil.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=necko-reviewers,credential-management-reviewers,devtools-reviewers,sgalich,kershaw
Depends on D183690

Differential Revision: https://phabricator.services.mozilla.com/D183691
2023-07-19 12:06:16 +00:00
Tooru Fujisawa 2355183b15 Bug 1843790 - Part 4: Rewrite toolkit/modules/FileUtils.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D183663
2023-07-18 23:06:32 +00:00
Tooru Fujisawa cd6d2d881f Bug 1843790 - Part 3: Rewrite toolkit/modules/Console.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D183662
2023-07-18 23:06:32 +00:00
Alexandre Poirot c158bae2fa Bug 1836856 - [devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy
This is no longer used. The returned promise should be used instead.

There was also some old lefovers in WebConsole Front related to network events.
As we no longer have legacy listeners, this is no longer used.
The frontend code now uses DevToolsClient.request directly to query the NetworkEventActor's.

Differential Revision: https://phabricator.services.mozilla.com/D180980
2023-06-26 11:08:46 +00:00
Sandor Molnar 49cbc9e36b Backed out 3 changesets (bug 1836856) for causing mochitest failures in devtools/shared/webconsole/test/chrome/test_network_security-hsts.html CLOSED TREE
Backed out changeset 636272515c00 (bug 1836856)
Backed out changeset 0fe632ebb487 (bug 1836856)
Backed out changeset 6850948b14c0 (bug 1836856)
2023-06-23 14:36:31 +03:00
Alexandre Poirot e92e641b51 Bug 1836856 - [devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy
This is no longer used. The returned promise should be used instead.

There was also some old lefovers in WebConsole Front related to network events.
As we no longer have legacy listeners, this is no longer used.
The frontend code now uses DevToolsClient.request directly to query the NetworkEventActor's.

Differential Revision: https://phabricator.services.mozilla.com/D180980
2023-06-23 08:22:04 +00:00
Barret Rennie c21ee0d6d6 Bug 1747468 - Remove FileUtils.getFile from devtools/ r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D180461
2023-06-15 01:59:11 +00:00
Nicolas Chevobbe 328e6ba0a9 Bug 1835680 - [devtools] Use proxy target when walking up prototype chain for autocomplete. r=devtools-reviewers,jdescottes.
In the JSPropertyProvider, we are walking up the prototype to retrieve properties.
For proxies with `getPrototypeOf` trap, this means that we were returning erroneous
values, as the prototype chain of the proxy isn't altered by the trap.
Worse, it could lead to infinite loop if the trap was setting a circular reference.

To avoid this, when dealing with a proxy, we retrieve the prototype of the proxy
target.

Test cases are added to ensure we don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D179640
2023-06-01 15:30:18 +00:00
Stanca Serban ebb32fa89e Backed out changeset 2f0f9d27fb0d (bug 1835680) for causing mochitests failures in test_jsterm_autocomplete.html. CLOSED TREE 2023-06-01 12:09:17 +03:00
Nicolas Chevobbe 73f79879ed Bug 1835680 - [devtools] Use proxy target when walking up prototype chain for autocomplete. r=devtools-reviewers,jdescottes.
In the JSPropertyProvider, we are walking up the prototype to retrieve properties.
For proxies with `getPrototypeOf` trap, this means that we were returning erroneous
values, as the prototype chain of the proxy isn't altered by the trap.
Worse, it could lead to infinite loop if the trap was setting a circular reference.

To avoid this, when dealing with a proxy, we retrieve the prototype of the proxy
target.

Test cases are added to ensure we don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D179640
2023-06-01 08:38:35 +00:00
Tooru Fujisawa af93372662 Bug 1832766 - Do not use lexical variable in test_jsterm_autocomplete.html to avoid redeclaration error in verify mode. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D179171
2023-05-26 10:45:51 +00:00
Tooru Fujisawa 504c8e1285 Bug 1831819 - Remove per-global function support in eager evaluation allow list. r=devtools-reviewers,nchevobbe
Stop supporting instance methods and getters in allowlist.
Now the allowlist is independent of global and can be shared across multiple
globals.

Differential Revision: https://phabricator.services.mozilla.com/D178884
2023-05-26 10:45:27 +00:00
Noemi Erli 7d41e7869b Backed out 3 changesets (bug 1831819, bug 1832769, bug 1831826) for causing build bustages in Object-isSameNativeWithJitInfo.js CLOSED TREE
Backed out changeset 260ffbbe45e0 (bug 1832769)
Backed out changeset e6a25ac049e4 (bug 1831819)
Backed out changeset dc4f6fa24aa3 (bug 1831826)
2023-05-26 06:17:20 +03:00
Tooru Fujisawa 6a2ac06235 Bug 1831819 - Remove per-global function support in eager evaluation allow list. r=devtools-reviewers,nchevobbe
Stop supporting instance methods and getters in allowlist.
Now the allowlist is independent of global and can be shared across multiple
globals.

Differential Revision: https://phabricator.services.mozilla.com/D178884
2023-05-26 02:53:58 +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
Tooru Fujisawa b63a55d9fa Bug 1820951 - Part 1: Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r=nchevobbe,devtools-reviewers
Perform the same test as `nativeIsEagerlyEvaluateable` in `hasSafeGetter`.

Differential Revision: https://phabricator.services.mozilla.com/D175093
2023-05-12 06:21:41 +00:00
Tooru Fujisawa 283d429cea Bug 1815381 - Part 3: Remove DOM getters from explicit allowlist. r=nchevobbe,devtools-reviewers,ochameau
Now that all DOM getters are caught by `isNativeGetterWithJitInfo`,
we don't need the DOM getters in explicit allowlist.

Differential Revision: https://phabricator.services.mozilla.com/D175091
2023-05-12 06:21:41 +00:00
Mark Banner 0fadbc1ec4 Bug 1829618 - Enable Prettier on json files (automatic fixes). r=perftest-reviewers,webcompat-reviewers,extension-reviewers,andi,desktop-theme-reviewers,pip-reviewers,devtools-reviewers,sync-reviewers,mossop,denschub,dao,sparky,robwu,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D176336
2023-05-09 16:14:51 +00:00
Alexandre Poirot cd7f049054 Bug 1830919 - [devtools] Remove unused add-on versus original commands. r=devtools-reviewers,jdescottes
We used to support commands being registered by Add-ons or third party code.
We no longer do and can simplify this class.

This helped see a private field usage from eval-with-debugger.

Also remove hasCommand and getCommand which aren't used.
These methods were used in the past to wrap/chain commands,
which isn't done anymore.

Differential Revision: https://phabricator.services.mozilla.com/D177139
2023-05-09 11:45:24 +00:00
Alexandre Poirot a8fa2fe085 Bug 1830919 - [devtools] Use explicit modules for web console commands management in the server codebase. r=devtools-reviewers,jdescottes
This code has been left unchanged since Firebug...
This ought some maintenance to better highlight where to implement new commands.
"utils.js" wasn't great ;)

Doing this highlights the fact that we have two type of commands.
See the new jsdoc alonside validCommands.

Differential Revision: https://phabricator.services.mozilla.com/D177138
2023-05-09 11:45:24 +00:00
Mathew Hodson f5014038b0 Bug 1824606 - Update Reflect consumers to ESM. r=Standard8,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D175201
2023-04-14 08:48:39 +00:00
Nicolas Chevobbe 70245631b7 Bug 860312 - [devtools] Add LegacyLenientThis getters to unsafe list. r=devtools-reviewers,ochameau.
Getters with LegacyLenientThis attribute will trigger a warning in the console
if it's called with the unexpected `this`.
We can't tell in DevTools if we have the "right" `this`.
For example displaying an `HTMLDivElementPrototype` object, we'll trigger the
warning because of the `onmouseenter` getter, which is supposed to be called
with the `HTMLElement` instance, which we don't have at this point.

For this reason, we exclude those from being safe getters, which will prevent
triggering the warning.

Differential Revision: https://phabricator.services.mozilla.com/D174070
2023-04-11 06:25:58 +00:00
Nicolas Chevobbe cab2e6654d Bug 860312 - [devtools] Generate list of unsafe getters. r=devtools-reviewers,ochameau.
We'll only need those names to avoid executing getters.
The file is renamed to better convey what data it represents.

Differential Revision: https://phabricator.services.mozilla.com/D174056
2023-04-11 06:25:56 +00:00
Tooru Fujisawa 8ccbac98ad Bug 1806598 - Part 6: Add Location accessors, window.location, and document.location to allowlist. r=nchevobbe
Location related accessors are not marked Pure, but some testcase expects
them to be eagerly evaluateable.

Differential Revision: https://phabricator.services.mozilla.com/D168340
2023-02-07 07:36:16 +00:00
Tooru Fujisawa 7f2aefdc4c Bug 1806598 - Part 5: Add Window accessors to allowlist. r=nchevobbe
Add support for [Global] extended attribute and methods/getters on instances.

This retrieves the Xray getter function of the given eval global, so that even
if some configurable properties are modified by the web content, debugger
can see the original getters, and pass them to isSameNativeWithJitInfo.

Differential Revision: https://phabricator.services.mozilla.com/D168339
2023-02-07 07:36:15 +00:00
Tooru Fujisawa 5f7402f606 Bug 1806598 - Part 4: Collect safe DOM getters into webidl-pure-allowlist.js. r=nchevobbe
Also refactor the allowlist structure to represent static vs prototype and
methods vs getters clearly.

And also moved the pre-defined pure methods list into GenerateDataFromWebIdls.py
for simplicity.

Differential Revision: https://phabricator.services.mozilla.com/D168338
2023-02-07 07:36:15 +00:00
Sandor Molnar 190b92321c Backed out 11 changesets (bug 1806598, bug 1812905, bug 1812540) for causing dt failures in devtools/client/webconsole/test/browser/browser_console_evaluation_context_selector.js CLOSED TREE
Backed out changeset 3b0e28b20def (bug 1812540)
Backed out changeset 810ed5832764 (bug 1812540)
Backed out changeset 9e042da8472f (bug 1806598)
Backed out changeset ab04e3122f20 (bug 1806598)
Backed out changeset f97c01add0a5 (bug 1806598)
Backed out changeset de9d04dc5014 (bug 1806598)
Backed out changeset 3808fc5bf528 (bug 1806598)
Backed out changeset 9be2509e8540 (bug 1806598)
Backed out changeset 3fc6c5d9d620 (bug 1806598)
Backed out changeset 297a91be123b (bug 1806598)
Backed out changeset 24cc5069faf3 (bug 1812905)
2023-02-06 07:19:51 +02:00
Tooru Fujisawa a872bd3260 Bug 1806598 - Part 6: Add Location accessors, window.location, and document.location to allowlist. r=nchevobbe
Location related accessors are not marked Pure, but some testcase expects
them to be eagerly evaluateable.

Differential Revision: https://phabricator.services.mozilla.com/D168340
2023-02-06 03:42:36 +00:00
Tooru Fujisawa 6c7c4283d1 Bug 1806598 - Part 5: Add Window accessors to allowlist. r=nchevobbe
Add support for [Global] extended attribute and methods/getters on instances.

This retrieves the Xray getter function of the given eval global, so that even
if some configurable properties are modified by the web content, debugger
can see the original getters, and pass them to isSameNativeWithJitInfo.

Differential Revision: https://phabricator.services.mozilla.com/D168339
2023-02-06 03:42:36 +00:00
Tooru Fujisawa 355e58e88e Bug 1806598 - Part 4: Collect safe DOM getters into webidl-pure-allowlist.js. r=nchevobbe
Also refactor the allowlist structure to represent static vs prototype and
methods vs getters clearly.

And also moved the pre-defined pure methods list into GenerateDataFromWebIdls.py
for simplicity.

Differential Revision: https://phabricator.services.mozilla.com/D168338
2023-02-06 03:42:36 +00:00