Open Bug 1499988 Opened 1 year ago Updated 1 year ago

Fix Protocol.js documentation

Categories

(DevTools :: General, enhancement, P2)

enhancement

Tracking

(Not tracked)

People

(Reporter: yulia, Unassigned)

References

(Blocks 1 open bug)

Details

Our protocol.js documentation is out of date. It recommends the following: 

https://searchfox.org/mozilla-central/source/devtools/docs/backend/protocol.js.md#75-76

```
    const HelloFront = protocol.FrontClassWithSpec(helloWorldSpec, {
      initialize: function (client, form) {
        protocol.Front.prototype.initialize.call(this, client, form);
        // This call may not be required but it's a good idea. It will
        // guarantee that your instance is managed in the pool.
        this.manage(this);
      }
    });
```

This results in the entire form object being passed into the front method, and if it is the form that we get with the target getFront method, then the `actor` field will always be `frameTarget`.

We need to update this documentation to either not pass in the form at all and set the actor ID manually (since the form parameter should go away soon: https://searchfox.org/mozilla-central/source/devtools/shared/protocol.js#1289-1292

or, we should change the documentation to follow this pattern: https://searchfox.org/mozilla-central/source/devtools/shared/fronts/reflow.js#20
Severity: normal → enhancement
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.