Open
Bug 1709292
Opened 3 years ago
Updated 3 years ago
Expose a single API to check for watcher support
Categories
(DevTools :: General, task, P3)
DevTools
General
Tracking
(Not tracked)
NEW
People
(Reporter: jdescottes, Unassigned)
References
Details
We expose two APIs in devtools to check for watcher support:
- hasTargetWatcherSupport
- hasResourceWatcherSupport
They both rely on the availability of a WatcherFront and then check traits on this watcher front.
But hasTargetWatcherSupport is sometimes used to check traits which are not related at all to a target type: eg https://searchfox.org/mozilla-central/rev/185ab5e4f4e01341e009cd4633d1275ffe4d4c8b/devtools/shared/commands/target-configuration/target-configuration-command.js#38-40
return this._commands.targetCommand.hasTargetWatcherSupport(
"target-configuration"
);
We could replace both APIs with a single API with a clear signature:
/**
* Check if the watcher is supported and additionally check for specific support of a
* resourceType, targetType or custom trait.
*
* @param {Object} options
* @param {String} options.resourceType
* @param {String} options.targetType
* @param {String} options.trait
* @return {Boolean} true if the watcher is supported
*/
hasWatcherSupport({ resourceType, targetType, trait }) { /* ... */ }
Reporter | ||
Comment 1•3 years ago
|
||
I am also slightly modifying the APIs and call sites in Bug 1709269
Depends on: 1709269
You need to log in
before you can comment on or make changes to this bug.
Description
•