Commit graph

180 commits

Author SHA1 Message Date
Alexandre Poirot
94e02496ef Bug 1666534 - [devtools] Listen to extension storages via a server side watcher. r=devtools-reviewers,nchevobbe,jdescottes
This was the last resource type requiring to keep the old storage actor as-is.
This will help drastically simplify it and move storage type code into each Resource Watcher class.

Differential Revision: https://phabricator.services.mozilla.com/D166661
2023-01-29 20:50:47 +00:00
Gijs Kruitbosch
090510953c Bug 1808993 - import ES modules as ES modules for devtools/client, r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D166230
2023-01-07 14:15:59 +00:00
Nicolas Chevobbe
77c721a468 Bug 1803646 - [devtools] Pass storage-expires-session localized value to getStoreObjects. r=jdescottes,fluent-reviewers,flod.
We need the string in devtools/shared `naturalOrder`, but we can't directly retrieve
it from the fluent file as it lives on the client (and won't be available in the
server on Android).
As the client and server might have different locales, we can't move the string
to devtools/shared.
Since the function is used from the server to make sure the data is displayed
properly on the UI, we pass the localized string to `getStoreObjects` so it's
then available to `naturalOrder`.
Tests are updated to match the new signature.

Differential Revision: https://phabricator.services.mozilla.com/D164354
2022-12-14 09:50:15 +00:00
Alexandre Poirot
23691e0542 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
4dc40e1b02 Bug 1792847 - [devtools] Use absolute URLs to import modules in devtools/client. r=jdescottes,nchevobbe
Everywhere but:
* the debugger (to be done independently)
* jsonview (uses custom resource:// URLs)
* dependencies of jsonview in client/shared (reps, react, and two components)
* one dependency of performance-new (fluent-react)

This will greatly help migrating to ES Modules which don't support path and only URLs or relatives.

Differential Revision: https://phabricator.services.mozilla.com/D158324
2022-09-30 15:17:34 +00:00
Alexandre Poirot
8020b268c4 Bug 1791828 - [devtools] Remove devtools lazyImporter in favor of ChromeUtils.defineModuleGetter. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D157910
2022-09-26 10:48:04 +00:00
Julian Descottes
d97d7ca5d8 Bug 1790889 - Use width and height properties for splitters in the Storage Inspector and StyleEditor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D157375
2022-09-15 07:26:22 +00:00
Mark Banner
c83937cb5a Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for devtools. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D155167
2022-08-26 13:39:34 +00:00
Mark Banner
a6855db57e 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
Michael Ratcliffe
8976ddfab0 Bug 1774687 - Stop debouncing with DeferredTask in DevTools r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D149575
2022-06-22 21:15:12 +00:00
Michael Ratcliffe
a139eedb97 Bug 1713316 - IndexedDB DevTools does not load more than 50 items r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D148338
2022-06-17 16:04:07 +00:00
Nicolas Chevobbe
e2128559ec Bug 1763313 - [devtools] Make NON_L10N_STRINGS dict similar to HEADERS_L10N_IDS. r=jdescottes.
Depends on D143012.

Differential Revision: https://phabricator.services.mozilla.com/D143562
2022-04-13 12:47:57 +00:00
Nicolas Chevobbe
5c8a5c6759 Bug 1763313 - [devtools] Migrate storage panel to Fluent. r=jdescottes,flod
Both the dtd and properties files strings are moved to the existing storage.ftl.
A migration file was added to keep the localized strings.

Some of the strings were migrated to a declarative approach, setting `data-l10n-id` and
`data-l10n-args` attributes on elements. But in other cases, this was not easily doable.
To accomodate with the asynchronicity of `formatValue`, we translate all the strings that
don't have dynamic parameters during the initialization of the panel, and store them in
a Map for easy retrieval.

We also took this opportunity to cleanup the strings key names and have them all prefixed
with `storage-*`. Some functions where refactored so it should be easier to search the
code for a specific l10n string.

Finally, the `table.headers.indexedDB.*` strings weren't migrated as they were never read
in the UI (they are referenced in `NON_L10N_STRINGS`, which bypass localization).

Differential Revision: https://phabricator.services.mozilla.com/D143012
2022-04-13 12:47:57 +00:00
Jan Odvarko
340fc67179 Bug 1753614 - [devtools] Rename mdn-utils file r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D138410
2022-02-11 17:18:41 +00:00
Jan Odvarko
6da05abb10 Bug 1753426 - [devtools] Fix documentation links in the source code r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D137748
2022-02-07 13:08:10 +00:00
Norisz Fay
f20c5c07db Backed out changeset 3e8efb4985f7 (bug 1753426) for causing multiple devtools failures 2022-02-04 16:17:25 +02:00
Jan Odvarko
0d6fafe87e Bug 1753426 - [devtools] Fix documentation links in the source code r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D137748
2022-02-04 11:40:50 +00:00
Nicolas Chevobbe
72a01fca06 Bug 1741811 - [devtools] Make watchTargets take a single object param. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D131755
2021-11-23 13:23:35 +00:00
Narcis Beleuzu
81698c54eb Backed out changeset 9dfd5e6601a1 (bug 1505304) as requested by nchevobbe 2021-11-23 14:56:24 +02:00
Nicolas Chevobbe
5d77281fc2 Bug 1505304 - [devtools] Make watchTargets take a single object param. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D131755
2021-11-23 12:39:19 +00:00
Nicolas Chevobbe
3dd22f3100 Bug 1713072 - [devtools] Fix storage inspector cross process navigation when fission is disabled. r=ochameau.
In the ParentProcessStorage class, we are listening for window-global-created/destroyed
event to notify the client that hosts can be added/removed.
But in case of bfcache navigation, those events are not emitted.

In order to fix this issue, we forward pageshow and pagehide events from the
DevToolsFrameChild to the DevToolsFrameParent, where the watcher actor can emit
those events, which we'll be listened to by the ParentProcessStorage.

Test cases are added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D118325
2021-07-19 12:29:44 +00:00
Belén Albeza
df2ff6decf Bug 1710077 - Part 1: Support target switching for cookies / indexedDB r=jdescottes,ochameau
This adds support for server target-switching for parent process storage resources (cookies and indexedDB at the moment)

Differential Revision: https://phabricator.services.mozilla.com/D114600
2021-06-09 15:34:01 +00:00
Alexandre Poirot
ecf535689e 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
185ab5e4f4 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
4aee693953 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
Sebastian Zartner
9d14b2b11c Bug 1613356 - Fixed storage data inspection for empty strings. r=ladybenko
Differential Revision: https://phabricator.services.mozilla.com/D110773
2021-04-22 23:01:07 +00:00
Alexandre Poirot
247b41df3c Bug 1696372 - [devtools] Migrate the rest of DevTools from toolbox.targetList to commands.TargetCommand. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D110212
2021-03-30 21:29:40 +00:00
Belén Albeza
5a57502c75 Bug 1666529 - [devtools] Part 1: Add cookie storage resource r=ochameau,jdescottes,devtools-backward-compat-reviewers
This adds a resource for the cookie storage type, that supports inspecting iframes, etc. on Fission.

NOTE: in order to use this new resource, set the `devtools.testing.enableServerWatcherSupport` to `true`

Differential Revision: https://phabricator.services.mozilla.com/D108040
2021-03-27 16:30:28 +00:00
Butkovits Atila
a62df7ef05 Backed out 2 changesets (bug 1666529) for causing lint failures.
Backed out changeset 24a6a96f3536 (bug 1666529)
Backed out changeset 3be87c868f09 (bug 1666529)
2021-03-26 18:42:31 +02:00
Belén Albeza
73f1a65656 Bug 1666529 - [devtools] Part 1: Add cookie storage resource r=ochameau,jdescottes,devtools-backward-compat-reviewers
This adds a resource for the cookie storage type, that supports inspecting iframes, etc. on Fission.

NOTE: in order to use this new resource, set the `devtools.testing.enableServerWatcherSupport` to `true`

Differential Revision: https://phabricator.services.mozilla.com/D108040
2021-03-26 14:12:52 +00:00
Alexandre Poirot
ac04c532a5 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
c2b5a6345f Bug 1685474 - [devtools] Stop having intermediate "storage resources" dictionary. r=ladybenko
* onResourceListAvailable and populateStorageTree were both computing distinct dictinary. `storages` versus `this.storageResources` (with the resourcesWithHosts making them both differents). It is easier to follow if we have only one dictionary, build by onResourceListAvailable and that's the straight object given by the ResourceWatcher API.
* Since we migrated to resources API. `resources` object passed to onResourceAvailable
should no longer have any `from` attribute. This is no longer a RDP packet, but an array computed by the ResourceWatcher API.
* This isn't really useful to filter out resources with empty `hosts` because `populateTreeFromResource` will be a noop
if that's empty. I think it is easier to follow if we pass all the resources to this method.

Differential Revision: https://phabricator.services.mozilla.com/D105646
2021-02-22 21:04:20 +00:00
Alexandre Poirot
cfda62b223 Bug 1685474 - [devtools] Rename storageTypes to storageResources. r=ladybenko
This variable name was confusing and didn't help understand the great complexity of this object.
This is a dictionary of storage resources, which also happen to be fronts, keyed by storage type/key (string).

Differential Revision: https://phabricator.services.mozilla.com/D105645
2021-02-22 21:04:20 +00:00
Alexandre Poirot
256ca192eb Bug 1685474 - [devtools] Clear storage fronts/resources when a target is destroyed. r=ladybenko
Differential Revision: https://phabricator.services.mozilla.com/D105224
2021-02-22 21:04:19 +00:00
Alexandre Poirot
edce8d4404 Bug 1685474 - [devtools] Stop using resource-updated and resource-destroyed for storage resources. r=ladybenko,devtools-backward-compat-reviewers
Resource updates and destroyed were ignored because the singleton storage resource
was cleaned on will-navigate.
So, we instead revert back to listen to events on fronts.
But instead of listening to a unique event on storageFront,
we listen to each individual storage resource front (one per type and per target).
This is why we have to do some filtering, still. Both on legacy listener and Watcher classes.

I'm also clarfifying things a bit in ContentProcessStorageWatcher,
I forked StorageActor completely, while removing its protocol.js Actor inheritance
and some stuff that we don't need for the Watcher class.

This help emitting stores-updated and stores-cleared and reuse the exact same
code between legacy listener and watcher class regarding filtering.

Differential Revision: https://phabricator.services.mozilla.com/D104687
2021-02-22 21:04:19 +00:00
Julian Descottes
148634a849 Bug 1654998 - [devtools] Check supports traits directly on individual storage fronts r=ladybenko
Depends on D93081

Differential Revision: https://phabricator.services.mozilla.com/D93082
2020-10-28 20:34:03 +00:00
Julian Descottes
b5906333d9 Bug 1654998 - [devtools] Remove backward compatibility code from storage-ui::_readSupportsTraits r=ladybenko
Traits support was added to the storage actor in FF80.
Firefox release is now FF81 so we can cleanup the related backward compatibility code.

Differential Revision: https://phabricator.services.mozilla.com/D93081
2020-10-28 20:19:06 +00:00
Belén Albeza
e6d07a37fa Bug 1666519 - Part 1: [devtools] Add localStorage resource r=ochameau
Tests are added in the next revision of the stack: D93808

Differential Revision: https://phabricator.services.mozilla.com/D92634
2020-10-23 11:58:45 +00:00
Bogdan Tara
3f38cbb0f8 Backed out 2 changesets (bug 1666519) for devtools leaks and failures CLOSED TREE
Backed out changeset 94c066ab05dc (bug 1666519)
Backed out changeset 990b312b5abe (bug 1666519)
2020-10-21 18:42:25 +03:00
Belén Albeza
223b34efcf Bug 1666519 - Part 1: [devtools] Add localStorage resource r=ochameau
Tests are added in the next revision of the stack: D93808

Differential Revision: https://phabricator.services.mozilla.com/D92634
2020-10-21 14:05:14 +00:00
David Walsh
9dab095b52 Bug 1625935 - [devtools] Implement ResourceWatcher with legacy listeners for Storage panel r=ochameau
This is D86050, rebased on top of current central. I kept it a separate commit, so the new stuff can be reviewed separately in a different revision.

Differential Revision: https://phabricator.services.mozilla.com/D91122
2020-10-02 09:31:03 +00:00
Julian Descottes
89386ea823 Bug 1654762 - Wait for store-objects-updated event in Storage Inspector init r=nchevobbe
Depends on D84689

The test failures are coming from a race condition which became visible with the previous patch in the stack.
The storage inspector head.js waits for an event emitted by the UI when opening the panel.
But now that we don't have to wait for the 4 actorHasMethod calls, the event is emitted before the test can listen for it.

One option is to let onTargetAvailable wait for the event instead, so that the Storage panel is only initialized when the store-objects-updated was fired.
This way, the test harness no longer has to wait for this event.

Differential Revision: https://phabricator.services.mozilla.com/D84788
2020-07-24 11:37:31 +00:00
Julian Descottes
d56c1d12bc Bug 1654762 - Use traits to detect DevTools storage actor supported methods r=nchevobbe,davidwalsh
This is the only meaningful callsite for actorHasMethod.
This method has many bugs and we want to replace it with traits

Differential Revision: https://phabricator.services.mozilla.com/D84689
2020-07-24 18:07:14 +00:00
Sebastian Zartner
19d52149f6 Bug 1309824 - Show proper descriptions for storage types. r=jdescottes,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D70663
2020-05-19 17:24:06 +00:00
Nicolas Chevobbe
2834d00a38 Bug 1636924 - Remove unnecessary isTopLevel and type properties from onTargetAvailable/onTargetDestroyed callback parameter. r=ochameau.
Since targetFronts now have isTopLevel and targetType properties, we can directly use
those, as the targetFront is included in the callback parameter.
This patch remove those properties and refactor consumer code.

Differential Revision: https://phabricator.services.mozilla.com/D74651
2020-05-15 16:03:32 +00:00
Razvan Maries
f5f48cab39 Backed out changeset 3c239920e8fb (bug 1636924) for perma failures on browser_ext_devtools_inspectedWindow.js CLOSED TREE 2020-05-15 15:33:15 +03:00
Nicolas Chevobbe
8140fccf69 Bug 1636924 - Remove unnecessary isTopLevel and type properties from onTargetAvailable/onTargetDestroyed callback parameter. r=ochameau.
Since targetFronts now have isTopLevel and targetType properties, we can directly use
those, as the targetFront is included in the callback parameter.
This patch remove those properties and refactor consumer code.

Differential Revision: https://phabricator.services.mozilla.com/D74651
2020-05-15 09:09:28 +00:00
Brindusan Cristian
f6e0d86cb5 Backed out changeset 1c4b489b6aa0 (bug 1309824) for dt failures at browser_tableWidget_basic.js. CLOSED TREE 2020-05-14 00:14:16 +03:00
Sebastian Zartner
b5e4795236 Bug 1309824 - Show proper descriptions for storage types. r=jdescottes,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D70663
2020-05-13 18:38:02 +00:00
Jason Laster
5f29a6d696 Bug 1622996 - Refactor devtools codebase to use optional chaining (automated changes). r=jdescottes
Depends on D67084

Differential Revision: https://phabricator.services.mozilla.com/D67537

--HG--
extra : moz-landing-system : lando
2020-03-19 21:13:38 +00:00