Open Bug 1692892 Opened 4 years ago Updated 4 years ago

Remove the FrameTargetActor

Categories

(DevTools :: Framework, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

With https://phabricator.services.mozilla.com/D104391 landed, the only difference between the FrameTargetActor and its base class BrowsingContextTargetActor is the title implementation:

FrameTargetActor:

Object.defineProperty(frameTargetPrototype, "title", {
  get: function() {
    return this.window.document.title;
  },
  enumerable: true,
  configurable: true,
});

https://searchfox.org/mozilla-central/rev/8cb90829ccf18f95cd75d8419c84729c754a8e83/devtools/server/actors/targets/frame.js#54-60

BrowsingContextTargetActor

  get webNavigation() {
    return this.docShell.QueryInterface(Ci.nsIWebNavigation);
  },

  get contentDocument() {
    return this.webNavigation.document;
  },

  get title() {
    return this.contentDocument.contentTitle;
  },

https://searchfox.org/mozilla-central/rev/8cb90829ccf18f95cd75d8419c84729c754a8e83/devtools/server/actors/targets/browsing-context.js#472-491

After some tests I haven't found any situation where the BrowsingContextTargetActor's implementation of title could return a valid title?
I tested:

  • webextension targets
  • parent process targets
  • chrome window targets

The title getter was added 7 years ago in https://bugzilla.mozilla.org/show_bug.cgi?id=937172, but I am not sure it ever worked? contentTitle doesn't seem available on document: https://searchfox.org/mozilla-central/source/dom/webidl/Document.webidl

contentTitle only seems available on browser elements.

Maybe this was meant to point to document.title?

You need to log in before you can comment on or make changes to this bug.