Commit Graph
52 Commits
Author SHA1 Message Date
Alexandre Poirot 9747f788db Bug 1807898 - [devtools] Set Telemetry sessionID by the Telemetry helper. r=devtools-reviewers,nchevobbe
This will help simplify all callsites manually setting this attribute.
I inlined simplification of all toolOpened/toolClosed in this changeset,
but all usages of recordEvent will be simplified in the next changeset.

Toolbox.sessionId is now only used by console performance markers in
order to help differentiate toolbox instances.

Note that about:debugging was also using a dedicated sessionId.

Differential Revision: https://phabricator.services.mozilla.com/D165935
2023-01-04 18:28:33 +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 465fac9684 Bug 1792847 - [devtools] Use absolute URLs to import modules in devtools/client/webconsole. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158380
2022-09-30 15:17:40 +00:00
Alexandre Poirot 0f32f335e3 Bug 1789201 - [devtools] Expose Services as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,julienw,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.Services.)/d" $(git grep -l 'require("Services")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .Services./d" $(git grep -l 'loader.lazyRequireGetter(this, "Services"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js
+ manual eslint fixes
+ removal of devtools-services in the debugger, except for jest tests

Differential Revision: https://phabricator.services.mozilla.com/D156401
2022-09-09 07:22:51 +00:00
Nicolas Chevobbe 53a8ae1c9e Bug 1776853 - [devtools] Set Browser Console window title according to its current mode. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D152728
2022-08-01 09:33:18 +00:00
Bogdan Szekely 69bbe7a93b Backed out 5 changesets (bug 1777253, bug 1776853) for causing devtools failures on browser_console_modes.js CLOSED TREE
Backed out changeset dbd68a657d6f (bug 1777253)
Backed out changeset f401150fb142 (bug 1776853)
Backed out changeset 209aade12fc6 (bug 1776853)
Backed out changeset dc24308ff8ef (bug 1776853)
Backed out changeset ea98ed858bae (bug 1776853)
2022-08-01 10:43:40 +03:00
Nicolas Chevobbe 947dda0ea0 Bug 1776853 - [devtools] Set Browser Console window title according to its current mode. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D152728
2022-08-01 06:55:55 +00:00
Nicolas Chevobbe 888449d0f4 Bug 1780156 - [devtools] Use private fields in BrowserConsole. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D150088
2022-07-20 07:17:15 +00:00
Cristian Tuns 3af62db16b Backed out 3 changesets (bug 1780156, bug 1777249) for causing mochitest on failures browser_console_evaluation_context_selector.js CLOSED TREE
Backed out changeset 6040e53370dc (bug 1777249)
Backed out changeset 61c455e77edc (bug 1780156)
Backed out changeset 2acbfa79b63e (bug 1780156)
2022-07-19 13:35:45 -04:00
Nicolas Chevobbe 996a08b143 Bug 1780156 - [devtools] Use private fields in BrowserConsole. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D150088
2022-07-19 14:02:58 +00:00
Nicolas Chevobbe f0c6879b4f Bug 1776145 - [devtools] Remove WebConsoleConnectionProxy. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D150087
2022-07-04 13:27:52 +00:00
Nicolas Chevobbe cb68e10ddc Bug 1776145 - [devtools] Remove unnecessary WebConsoleUI additionalProxies. r=ochameau,devtools-backward-compat-reviewers,jdescottes.
`WebConsoleConnectionProxy` is now only used for:
- listening to `lastPrivateContextExited`, which can be done from the top-level
  console front instead
- setting `NetworkMonitor.saveRequestAndResponseBodies` for toolbox we don't have
  network resource support for, which would be better done in `startWatchingNetworkResources`.

This means we don't need to keep a Map of additional proxies.
The only impact is on `clearMessagesCache`, where we now fetch all fronts with
`getAllFronts` instead of looping through the Map of additional proxies.
This change highlighted some race condition in tests, as it's now slightly slower.
So we add a new `clearMessagesCacheAsync` function, which is doing the same thing
as `clearMessagesCache`, except it's not `oneway`, so we can know when the cache
was indeed cleared, and we emit an event to indicate when the cache was cleared.
We can't simply remove `oneway` from `clearMessagesCache` as it causes backward
compatibility issues we can't avoid.
This also highlighted an issue with the cache not being cleared on `console.clear`
when it is batched, so we fix this (a test was failing without it).

The next patch in the queue will completely remove `WebConsoleConnectionProxy`.

Differential Revision: https://phabricator.services.mozilla.com/D150085
2022-07-04 13:27:51 +00:00
Alexandre Poirot f3b6620342 Bug 1701790 - Migrate ResourceWatcher to become ResourceCommand. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D113930
2021-05-04 09:29:47 +00:00
Brindusan Cristian d5be5fbb54 Backed out 5 changesets (bug 1701790) for bc failures in browser_ext_devtools_network_targetSwitch.js. CLOSED TREE
Backed out changeset 3fc4edd663d9 (bug 1701790)
Backed out changeset 2d3ea7c0d695 (bug 1701790)
Backed out changeset 6cb7502fc1a2 (bug 1701790)
Backed out changeset 8f4205a1a369 (bug 1701790)
Backed out changeset bd3c9b1482c7 (bug 1701790)
2021-05-03 22:21:59 +03:00
Alexandre Poirot 8479ca9cbb Bug 1701790 - Mass replace resourceWatcher with resourceCommand. r=nchevobbe
$ sed -i 's/resourceWatcher/resourceCommand/g' $(egrep -rl 'resourceWatcher' devtools/)

Differential Revision: https://phabricator.services.mozilla.com/D113933
2021-05-03 18:07:31 +00:00
Alexandre Poirot b007493360 Bug 1701790 - Migrate ResourceWatcher to become ResourceCommand. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D113930
2021-05-03 18:07:30 +00:00
Alexandre Poirot 36fb1f5d65 Bug 1696374 - [devtools] Renamed TargetList occurences to TargetCommand. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D110386
2021-04-12 07:59:52 +00:00
Alexandre Poirot d43edf6ca5 Bug 1696374 - [devtools] Stop storing targetList on WebConsole hud. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D110382
2021-04-12 07:59:51 +00:00
Alexandre Poirot 39cae4d3eb Bug 1700337 - [devtools] Make the BrowserConsole code slightly less target centric. r=nchevobbe
- we don't need to override WebConsole.currentTarget as it should pull the current top target via targetList instead of toolbox
- BrowserConsole constructor then no longer need to receive the target as argument
- and finally, BrowserConsoleManager can pass around the descriptor instead of the first target.

Differential Revision: https://phabricator.services.mozilla.com/D109493
2021-03-25 16:02:31 +00:00
Alexandre Poirot d0cb4d3694 Bug 1693491 - [devtools] Migrate TargetList to be a command r=nchevobbe,rpl
This changeset is incomplete and focus on places where we instantiate TargetList constructor

Differential Revision: https://phabricator.services.mozilla.com/D105611
2021-03-11 12:53:18 +00:00
Alexandre Poirot ec5d85ae84 Bug 1691681 - [devtools] Introduce "commands" in order to ease calling global commands throught the Watcher. r=nchevobbe,bomsy,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D97575
2021-03-03 17:02:42 +00:00
Alexandre Poirot 15d320c4f0 Bug 1692874 - [devtools] Use descriptors instead of targets in TargetList/Toolbox r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D105200
2021-02-18 18:36:47 +00:00
Nicolas Chevobbe 497dd030cd Bug 1642599 - [devtools] Enable all console messages server support everywhere. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D103285
2021-02-11 06:08:34 +00:00
Nicolas Chevobbe 6e27d77006 Bug 1662054 - Add a destroy function to targetList. r=jdescottes.
At the moment, we don't have any guards in the targetList to _not_ execute the
creation/destruction listeners once the toolbox gets destroyed.
We only have a stopListening function on the targetList that is called when we
close the toolbox, but we can't rely only on that since it's also called when
doing a target switch (and working around that is very racy).

One solution would be to follow the common pattern we have everywhere by having
a destroy method that we would check before trying to call the listeners callback.

This might help with intermittent test failures.

Differential Revision: https://phabricator.services.mozilla.com/D88765
2020-09-02 14:39:42 +00:00
Nicolas Chevobbe c261bf262b Bug 1657310 - Attach target and thread from TargetList. r=jdescottes,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D85398
2020-08-21 09:22:48 +00:00
Nicolas Chevobbe e74da93287 Bug 1607569 - Fix leak in browser_console_devtools_loader_exception. r=ochameau.
In the Browser toolbox destroy function, we now wait for
any pending connection initialization promise.
In the test we close the browser toolbox at the end.
We also need to guard a few method in the connection proxy
to ensure the instances we use are still alive before using
them.

Differential Revision: https://phabricator.services.mozilla.com/D71171
2020-05-12 07:05:27 +00:00
Cosmin Sabou 8b8c748ede Backed out changeset 0be5f9822cad (bug 1607569) because it shouldn't have been landed yet. DONTBUILD 2020-05-11 22:45:34 +03:00
Nicolas Chevobbe ae7b1eaf1c Bug 1607569 - Fix leak in browser_console_devtools_loader_exception. r=ochameau.
In the Browser toolbox destroy function, we now wait for
any pending connection initialization promise.
In the test we close the browser toolbox at the end.
We also need to guard a few method in the connection proxy
to ensure the instances we use are still alive before using
them.

Differential Revision: https://phabricator.services.mozilla.com/D71171
2020-05-11 16:50:20 +00:00
Alexandre Poirot be914a54df Bug 1620234 - Use the Resources API for console messages. r=jdescottes,nchevobbe
This demonstrates using the Resources API for the console messages,
using the existing actor methods. It helps proving that this will work against old runtimes.
But the plan is to followup in bug 1620243 so that we implement this code on the server side.
This will help getting rid of this LegacyImplementation code and have a simplier code on the server.

Differential Revision: https://phabricator.services.mozilla.com/D65526
2020-03-30 13:15:17 +00:00
Alexandre Poirot b8f7894aa5 Bug 1605763 - Emit 'web-console-created' after the BrowserConsole is fully loaded. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D62719
2020-02-13 13:50:30 +00:00
Alexandre Poirot c5a8a00e7d Bug 1605763 - Initialize browser console UI before attaching to all process targets. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D58947
2020-02-13 13:46:20 +00:00
Alexandre Poirot 5f63681ccf Bug 1598022 - Revisit TargetList.startListening in order to bundle in the type being listened. r=jdescottes
Before, each callsite had to mention which type it would like to listen to.
But at the same time, TargetList was gating this listening via the devtools fission preference.
It sounds easier if all the logic to define if we are listening to additional targets
and which types is written in one place.

Differential Revision: https://phabricator.services.mozilla.com/D57009
2020-01-08 15:30:34 +00:00
Alexandre Poirot d7502328e9 Bug 1592363 - Make the console use the TargetList. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D48860
2019-11-07 15:05:10 +00:00
Nicolas Chevobbe 72e88d7fd6 Bug 1577431 - Cleanup Browser Console when closing its window. r=ochameau.
We  store the created DebuggerClient when opening the Browser Console
so we can close it when closing the Browser Console window.
The Browser Console window `unload` event listener is moved out of
the BrowserConsole class to the BrowserConsoleManager, so we can close
the DebuggerClient when the window is closed (plus it makes more sense
to have it here since that's where we create the window).

Finally, functions that were inlined in toggleBrowserConsole are moved
as method of the BrowserConsoleManager for clarity.

Differential Revision: https://phabricator.services.mozilla.com/D43930
2019-08-29 15:31:12 +00:00
Nicolas Chevobbe 13b46fdc43 Bug 1576841 - Enable multi-proxy WebConsole in Browser Toolbox when fission pref is true. r=ochameau.
We remove the multiple this.fissionSupport properties to only check
the permission in the couple place we need it.

Differential Revision: https://phabricator.services.mozilla.com/D43585
2019-08-27 17:41:29 +00:00
Alexandre Poirot 680b2ec9e1 Bug 1570242 - Rename target to currentTarget in WebConsole codebase. r=nchevobbe,yulia
Do that to better highlight that the target can change over time.

Differential Revision: https://phabricator.services.mozilla.com/D41798
2019-08-22 08:10:13 +00:00
Alexandre Poirot c270ef4785 Bug 1570242 - Fetch target from toolbox instead of memoizing it on console classes. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D40017
2019-08-22 08:09:59 +00:00
Dorel Luca d2d5728ece Backed out 3 changesets (bug 1570242) for devtools failure in /webconsole/test/node/components/webconsole-wrapper.test.js. CLOSED TREE
Backed out changeset 854e62f7f1ae (bug 1570242)
Backed out changeset 304366165980 (bug 1570242)
Backed out changeset a213b28dd40f (bug 1570242)
2019-08-21 13:13:15 +03:00
Alexandre Poirot 93a50db401 Bug 1570242 - Rename target to currentTarget in WebConsole codebase. r=nchevobbe,yulia
Do that to better highlight that the target can change over time.

Differential Revision: https://phabricator.services.mozilla.com/D41798
2019-08-21 09:47:53 +00:00
Alexandre Poirot e2bb3ae1da Bug 1570242 - Fetch target from toolbox instead of memoizing it on console classes. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D40017
2019-08-21 09:47:44 +00:00
Nicolas Chevobbe 42b866ec0a Bug 1570320 - Rename hudservice into browser-console-manager. r=ochameau.
The file only manages the browser console, so we're
making its name reflect what it does.

Differential Revision: https://phabricator.services.mozilla.com/D40441
2019-08-05 11:40:58 +00:00
Alexandre Poirot 1a70ec55b5 Bug 1569569 - Make HUDService specific to the browser console. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D40021
2019-07-31 21:56:54 +00:00
Nicolas Chevobbe cae8319c82 Bug 1567832 - Retrieve fission pref and use it in console classes. r=yulia.
We retrieve the preference in the hudservice, where
WebConsoles and BrowserConsoles are created from.
If the pref is set to true, we assign a different
title to the Browser Console window so it will be
easier to spot.
The preference is then passes to the BrowserConsole,
WebConsole, WebConsoleUI and finally WebConsoleConnectionProxy
instances.
Later, we'll check this pref to connect to different
targets and listen to new ones.

Depends on D39646

Differential Revision: https://phabricator.services.mozilla.com/D39647
2019-07-29 08:44:08 +00:00
Victor Porof b7732ae890 Bug 1561435 - Format devtools/client/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884
2019-07-05 11:24:38 +02:00
Nicolas Chevobbe 49e8185499 Bug 1463128 - Refactor WebConsole and BrowserConsole to ES6 classes; r=bgrins.
Doing this allows us to use native `extends` instead of
the custom one.

Differential Revision: https://phabricator.services.mozilla.com/D20679
2019-02-27 10:05:51 +00:00
Gurzau Raul 3ee8fd7ce9 Backed out 5 changesets (bug 1463128) for failing at webconsole/autocomplete.js on a CLOSED TREE.
Backed out changeset 31a85e2ed53e (bug 1463128)
Backed out changeset fcd93f64c934 (bug 1463128)
Backed out changeset ae460b3a30c2 (bug 1463128)
Backed out changeset 97a1eeb8db65 (bug 1463128)
Backed out changeset c504e9730eac (bug 1463128)
2019-02-27 00:19:15 +02:00
Nicolas Chevobbe 997557b4cc Bug 1463128 - Refactor WebConsole and BrowserConsole to ES6 classes; r=bgrins.
Doing this allows us to use native `extends` instead of
the custom one.

Differential Revision: https://phabricator.services.mozilla.com/D20679
2019-02-26 14:45:00 +00:00
yulia 791e7cdc1a Bug 1485664 - remove attachConsole from the debugger client; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D20150
2019-02-20 10:27:50 +00:00
Nicolas Chevobbe 0431534ebd Bug 1527830 - Remove unused _filterPrefsPrefix in browser-console.js; r=yulia.
This property isn't used anymore, let's delete it.

Differential Revision: https://phabricator.services.mozilla.com/D19749
2019-02-14 11:01:36 +00:00
Mark Banner 3d6aaad3f5 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389
2018-10-19 12:55:39 +00:00