Commit Graph
197 Commits
Author SHA1 Message Date
echrs 07d1104355 Bug 1878635 - Remove Deprecated.sys.mjs r=Standard8,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D201737
2024-02-20 20:33:24 +00:00
Alexandre Poirot 140d755231 Bug 1845768 - [devtools] Only try to open URL as JS files in debugger/view-source if DevTools are opened in the current tab. r=devtools-reviewers,perftest-reviewers,jdescottes,sparky
This will prevent opening any links with the ":\d+" suffix anytime devtools were opened in the past.

Differential Revision: https://phabricator.services.mozilla.com/D185826
2023-08-21 08:01:36 +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
Alexandre Poirot 782c6e1335 Bug 1825511 - [devtools] Log JavaScript traces to stdout with hyperlinks and handle them in firefox startup. r=nchevobbe,devtools-reviewers
The JavaScript tracer will log special format of links, including a precise location,
by appending `@${line}:${column}` to each frame's source's URL.
This URL pattern is later interpreted by DevTools command line handler in order
to automatically open the source's location in the debugger.

Differential Revision: https://phabricator.services.mozilla.com/D174098
2023-05-12 11:33:27 +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
Alexandre Poirot b21b9df6a7 Bug 1807896 - [devtools] Remove "toolbox-created" event. r=devtools-reviewers,perftest-reviewers,sparky,jdescottes
This event was only used in this test.

Unfortunately, I wasn't able to keep the same logic in the test while keeping it reliable.
I prefer to remove this test-only event and simplify the test to only ensure
we safely ignore subsequent calls to toggle.

What is hard to know from the test, when calling toggle in some following event loops
is if this will be ignored -or- close/open a toolbox...

Differential Revision: https://phabricator.services.mozilla.com/D165715
2023-01-18 09:27:30 +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 768a07f851 Bug 1807937 - [devtools] Use gDevTools.showToolboxForWebExtension and showToolboxForTab from storage panel tests. r=devtools-reviewers,nchevobbe
Note that showToolbox already takes care of reusing existing toolbox if you pass the same tab element.
Otherwise let's try to stick to method used in production.
When debugging a local tab, we are using showToolboxForTab.
When debugging an addon, about:debugging calls showToolboxForWebExtension.

Also cleanup some legacy in the webext test.

Differential Revision: https://phabricator.services.mozilla.com/D165720
2023-01-05 17:37:58 +00:00
Gijs Kruitbosch ba3f869758 Bug 1803391 - update comments / text references to session store modules as 'jsm's, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D164127
2022-12-12 10:08:03 +00:00
Alexandre Poirot 6cfca638f1 Bug 1797730 - [devtools] Rename gDevTools._toolboxes to gDevTools._toolboxesPerCommands. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D160618
2022-10-29 07:48:08 +00:00
Alexandre Poirot c6d540d7d3 Bug 1794773 - [devtools] gDevTools.showToolbox should wait for toolbox to be "raised". r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D159142
2022-10-20 10:10:37 +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
Alexandre Poirot 0a2f14ed30 Bug 1700909 - [devtools] Migrate gDevTools.showToolbox from descriptor to commands. r=jdescottes,extension-reviewers,willdurand
This migrate gDevTools.showToolbox, but also the Toolbox now receives a commands right away,
and no longer need to create commands out of the descriptor front.

I'm removing browser_two_tabs as it is focusing on testing Tab Descriptors (RootFront.listTabs+getTab)
and Tab targets (TabDescriptor.getTarget).
Using getTarget on descriptor is legacy codepath for a while now.
We should now rather cover commands instead of these low level RDP methods.

Differential Revision: https://phabricator.services.mozilla.com/D157796
2022-10-11 20:33:53 +00:00
Alexandre Poirot d18bbea83e Bug 1700909 - [devtools] Migrate DescriptorMixin.shouldCloseClient to Commands. r=jdescottes
Note that this depends on the following patch, in order to destroy commands from the toolbox.
Commands have always been destroying the related client. This was a significant simplification in test.
So that I had to reverse the default value of shouldCloseClient and only toggle it to false
where it is strictly needed. Ideally only for about:debugging toolboxes (and two tests).

Differential Revision: https://phabricator.services.mozilla.com/D158206
2022-10-11 20:33:52 +00:00
Alexandre Poirot f8042a1a3a Bug 1700909 - [devtools] Migrate TabDescriptorFactory to LocalTabCommandsFactory. r=jdescottes
Also move iKnownTab to gDevTools.hasToolboxForTab as it feel more natural.

Differential Revision: https://phabricator.services.mozilla.com/D157943
2022-10-11 20:33:51 +00:00
Alexandre Poirot e0366a6c18 Bug 1700909 - [devtools] Stop exposing Toolbox.descriptorFront. r=jdescottes
Instead we should we querying Toolbox.commands.descriptorFront.

Differential Revision: https://phabricator.services.mozilla.com/D157942
2022-10-11 20:33:51 +00:00
Cristian Tuns c136da03a9 Backed out 5 changesets (bug 1700909) for causing mochitest failures CLOSED TREE
Backed out changeset a49f15f66ed4 (bug 1700909)
Backed out changeset 5a6b15eb1e12 (bug 1700909)
Backed out changeset 67b12d0e350b (bug 1700909)
Backed out changeset 4e6312ea547a (bug 1700909)
Backed out changeset c49eab385e1c (bug 1700909)
2022-10-10 10:38:03 -04:00
Alexandre Poirot 0ad9d97fbc Bug 1700909 - [devtools] Migrate gDevTools.showToolbox from descriptor to commands. r=jdescottes,extension-reviewers,willdurand
This migrate gDevTools.showToolbox, but also the Toolbox now receives a commands right away,
and no longer need to create commands out of the descriptor front.

I'm removing browser_two_tabs as it is focusing on testing Tab Descriptors (RootFront.listTabs+getTab)
and Tab targets (TabDescriptor.getTarget).
Using getTarget on descriptor is legacy codepath for a while now.
We should now rather cover commands instead of these low level RDP methods.

Differential Revision: https://phabricator.services.mozilla.com/D157796
2022-10-10 11:28:08 +00:00
Alexandre Poirot dfe621937e Bug 1700909 - [devtools] Migrate DescriptorMixin.shouldCloseClient to Commands. r=jdescottes
Note that this depends on the following patch, in order to destroy commands from the toolbox.
Commands have always been destroying the related client. This was a significant simplification in test.
So that I had to reverse the default value of shouldCloseClient and only toggle it to false
where it is strictly needed. Ideally only for about:debugging toolboxes (and two tests).

Differential Revision: https://phabricator.services.mozilla.com/D158206
2022-10-10 11:28:07 +00:00
Alexandre Poirot 820257de7c Bug 1700909 - [devtools] Migrate TabDescriptorFactory to LocalTabCommandsFactory. r=jdescottes
Also move iKnownTab to gDevTools.hasToolboxForTab as it feel more natural.

Differential Revision: https://phabricator.services.mozilla.com/D157943
2022-10-10 11:28:06 +00:00
Alexandre Poirot 62214956c9 Bug 1700909 - [devtools] Stop exposing Toolbox.descriptorFront. r=jdescottes
Instead we should we querying Toolbox.commands.descriptorFront.

Differential Revision: https://phabricator.services.mozilla.com/D157942
2022-10-10 11:28:05 +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 9beeb07755 Bug 1792847 - [devtools] Use absolute URLs to import modules in devtools/client/framework. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158373
2022-09-30 15:17:36 +00:00
Andreea Pavel 734e00a91f Backed out 5 changesets (bug 1700909) for failing browser_ext_addon_debugging_netmonitor.js on a CLOSED TREE
Backed out changeset 9bc3e4820f59 (bug 1700909)
Backed out changeset 998c0ec4f9d3 (bug 1700909)
Backed out changeset 6f6fe066fc38 (bug 1700909)
Backed out changeset e53aaf8ffe5b (bug 1700909)
Backed out changeset 3dbeffe25878 (bug 1700909)
2022-09-29 19:40:43 +03:00
Alexandre Poirot 2fa2a439ea Bug 1700909 - [devtools] Migrate gDevTools.showToolbox from descriptor to commands. r=jdescottes
This migrate gDevTools.showToolbox, but also the Toolbox now receives a commands right away,
and no longer need to create commands out of the descriptor front.

I'm removing browser_two_tabs as it is focusing on testing Tab Descriptors (RootFront.listTabs+getTab)
and Tab targets (TabDescriptor.getTarget).
Using getTarget on descriptor is legacy codepath for a while now.
We should now rather cover commands instead of these low level RDP methods.

Differential Revision: https://phabricator.services.mozilla.com/D157796
2022-09-29 14:43:26 +00:00
Alexandre Poirot 06d9cc9c05 Bug 1700909 - [devtools] Migrate DescriptorMixin.shouldCloseClient to Commands. r=jdescottes
Note that this depends on the following patch, in order to destroy commands from the toolbox.
Commands have always been destroying the related client. This was a significant simplification in test.
So that I had to reverse the default value of shouldCloseClient and only toggle it to false
where it is strictly needed. Ideally only for about:debugging toolboxes (and two tests).

Differential Revision: https://phabricator.services.mozilla.com/D158206
2022-09-29 14:43:26 +00:00
Alexandre Poirot 03239d33fd Bug 1700909 - [devtools] Migrate TabDescriptorFactory to LocalTabCommandsFactory. r=jdescottes
Also move iKnownTab to gDevTools.hasToolboxForTab as it feel more natural.

Differential Revision: https://phabricator.services.mozilla.com/D157943
2022-09-29 14:43:25 +00:00
Alexandre Poirot 0d20bb1ccb Bug 1700909 - [devtools] Stop exposing Toolbox.descriptorFront. r=jdescottes
Instead we should we querying Toolbox.commands.descriptorFront.

Differential Revision: https://phabricator.services.mozilla.com/D157942
2022-09-29 14:43:24 +00:00
Alexandre Poirot 58b38d7c16 Bug 1791969 - [devtools] Import all JSM in DevTools via ChromeUtils.import. r=jdescottes
Convert all imports but the one related to SessionDataHelper
as that's an hybrid module which is loaded as a JSM from the main thread,
but loaded as a common js module from the worker thread.

We will be able to drop this once we can migrate this JSM to ESM
once we support loading ESM from the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D158007
2022-09-26 13:01:33 +00:00
Alexandre Poirot 633eb069ef Bug 1791832 - [devtools] Convert devtools/startup JSM to ES Modules. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D157911
2022-09-26 10:48:05 +00:00
Alexandre Poirot 0c4e317914 Bug 1789980 - [devtools] Migrate all callsites using require("chrome") to use Components.* global symbols. r=jdescottes,perftest-reviewers,AlexandruIonescu
This will help transition to ES Modules as we won't be able to expose a magic "chrome" ESM.
Also, most of these symbols are exposed as global already.
All but:
* `components` which is `Components`,
* `CC` which is `Components.Constructor`,
* `Cm` which is `Components.manager`.

$ sed -ie "/require(.chrome.)/d" $(git grep -l 'require("chrome")' devtools/)
+ manual edits for all three exceptions

Differential Revision: https://phabricator.services.mozilla.com/D156936
2022-09-20 12:52:27 +00:00
Alexandre Poirot 4ff70fda6f Bug 1780912 - [devtools] Make the local web extension toolbox be always on top. r=nchevobbe,eemeli
This allows to keep the DevTools visible while interacting with the Firefox
window where the extension is running.

This behavior is enabled by default, but can be disable on-demand via a button
in the top toolbar.
Note that it requires to close and reopen the window/toolbox as platform APIs
disallow changing this behavior "live" on a given window.

Differential Revision: https://phabricator.services.mozilla.com/D155843
2022-09-15 07:31:31 +00:00
Nicolas Chevobbe 48647cab11 Bug 1788601 - [devtools] Fix ESLint consistent-return failures in devtools/client/framework. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D156159
2022-09-12 17:41:33 +00:00
Alexandre Poirot 86c7a14e62 Bug 1789202 - [devtools] Expose ChromeUtils as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.ChromeUtils.)/d" $(git grep -l 'require("ChromeUtils")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .ChromeUtils./d" $(git grep -l 'loader.lazyRequireGetter(this, "ChromeUtils"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js + manual eslint fixes

Differential Revision: https://phabricator.services.mozilla.com/D156402
2022-09-09 07:22:51 +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
Noemi Erli 233f0fcdf4 Backed out 2 changesets (bug 1780912) for causing failures in browser_aboutdebugging_addons_debug_console.js CLOSED TREE
Backed out changeset d2360a2a3d70 (bug 1780912)
Backed out changeset 21f1e9031be0 (bug 1780912)
2022-09-08 01:59:18 +03:00
Alexandre Poirot ce1e1a4cbe Bug 1780912 - [devtools] Make the local web extension toolbox be always on top. r=nchevobbe,eemeli
This allows to keep the DevTools visible while interacting with the Firefox
window where the extension is running.

This behavior is enabled by default, but can be disable on-demand via a button
in the top toolbar.
Note that it requires to close and reopen the window/toolbox as platform APIs
disallow changing this behavior "live" on a given window.

Differential Revision: https://phabricator.services.mozilla.com/D155843
2022-09-07 21:00:17 +00:00
Alexandre Poirot b1ec4a4679 Bug 1783821 - [devtools] Manual rewrites r=bomsy
In md files and code comments and mostly from common js files.

I'm moving away from require to load sys.mjs files so that we are closer
to what we do in mozilla-central.

Differential Revision: https://phabricator.services.mozilla.com/D154073
2022-09-05 12:29:57 +00:00
Alexandre Poirot 72d3ca6549 Bug 1787992 - [devtools] Expose gDevTools.showToolboxForWebExtension to open a webext toolbox in a dedicated window. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D155950
2022-09-01 08:41:49 +00:00
Daisuke Akatsuka d3b71faba0 Bug 1783877: Disable inspector quick action if already opening. r=daleharvey,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D155191
2022-08-24 22:02:44 +00:00
Mark Banner 6d03c63e2d Bug 1330099 - Enable object-shorthand eslint rule. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D153567
2022-08-03 14:57:05 +00:00
Alexandre Poirot 3c233a0461 Bug 1751207 - [devtools] Allow debugging popups when a toolbox is opened for its opener tab. r=nchevobbe
This is only an issue when devtools.popups.debug is false,
when it is true, the toolbox is move and a warning message is printed
if we request to open a new toolbox.

Differential Revision: https://phabricator.services.mozilla.com/D136498
2022-01-24 10:16:04 +00:00
Alexandre Poirot 269196c4e0 Bug 1569859 - [devtools] Automagically move the toolbox between the original tab we debug and its popups. r=nchevobbe
This is also behind "devtools.popups.debug", to be set to true manually.

This special mode break the old fundamental principal where a given toolbox
is bound to one unique given tab. Now one toolbox starts being shared between
many tabs.

When we select the original tab we debug, or any of its popups opened in distinct tabs,
we will move the toolbox between each of these tabs.
We will have one toolbox instance, one toolbox iframe, which will be moved
around each tab's host. This is somewhat similar to host switching within the same tab.
This is all based on the same trick where we swap the toolbox iframe to another location.

Differential Revision: https://phabricator.services.mozilla.com/D131802
2022-01-14 12:02:25 +00:00
Julian Descottes f098fdd604 Bug 1735359 - [devtools] Enable DevTools auto theme by default r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D128268
2021-10-21 21:08:24 +00:00
Julian Descottes bbf819fdf1 Bug 1735358 - [devtools] Switch back default theme from auto to light/dark r=nchevobbe
Depends on D128093

We will attempt to re-enable the auto theme by default in Bug 1735359

Differential Revision: https://phabricator.services.mozilla.com/D128239
2021-10-18 07:54:45 +00:00
Emilio Cobos Álvarez 8f19ad4e7a Bug 1670480 - Add an "auto" theme for devtools which follows the browser's color scheme. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D128093
2021-10-12 09:25:05 +00:00
Alexandre Poirot aa0138f159 Bug 1722553 - [devtools] Avoid enabling server targets for WebExtension commands. r=jdescottes
WebExtension reload command is still broken with target switching.
Enabling server targets would break this on all reloads.
So prevent enabling server targets until this is fixed.

Differential Revision: https://phabricator.services.mozilla.com/D120982
2021-07-28 12:04:32 +00:00
Alexandre Poirot d9628fcd91 Bug 1699493 - [devtools] Migrate WebExtInspectedWindow front to a command. r=nchevobbe,rpl
- implement the new "inspected-window" command
- move WebExtensionInspectedWindowFront implement to the command, making the front empty
- migrate tests to use the commands instead of front
- stop maintaining the current top level target in ExtensionParent.jsm, no longer have to use watchTargets
- stop creating a new descriptor on each new target
- instead only pull one new dedicated "commands" for WebExt (still in ExtensionParent.jsm)
- remove TabDescriptor isDevToolsExtensionContext as we no longer need anything special in the descriptor
- remove now unused methods on DevToolsShims (createWebExtensionInspectedWindowFront, createDescriptorForTabForWebExtension)
- remove the now unused TabDescriptorFactory.createDescriptorForTab's "forceCreationForWebextension" option, as CommandsFactory.forTab always instantiate a brand new commands
- migrate webext to use the command instead of front

Differential Revision: https://phabricator.services.mozilla.com/D108994
2021-04-01 10:31:43 +00:00
Julian Descottes f98c0a05c5 Bug 1695046 - [devtools] Use the same signature for showToolbox and showToolboxForTab r=ochameau,nchevobbe,rpl
Depends on D107100

Differential Revision: https://phabricator.services.mozilla.com/D106539
2021-03-11 06:32:15 +00:00