Bug 1405288 - Remove resolveRelativeURL actor method check from the inspector draft
authorPatrick Brosset <pbrosset@mozilla.com>
Thu, 19 Oct 2017 10:57:30 +0200
changeset 701118 791f56889e1951ad20a1224f62f2f8c1524b22dc
parent 701117 52f879916a06055692c6806045d838ac5fdb5734
child 701119 4deccbc18db863d63d221e3a25777e581ce5ec34
push id90078
push userbmo:pbrosset@mozilla.com
push dateTue, 21 Nov 2017 08:39:27 +0000
bugs1405288, 921102
milestone59.0a1
Bug 1405288 - Remove resolveRelativeURL actor method check from the inspector The resolveRelativeURL actor method was added in bug 921102 which shipped with Firefox 40. This was 3 years ago, and well older than the latest current ESR (52), which is the latest version we support. MozReview-Commit-ID: 5X5czLP5v2E
devtools/client/inspector/inspector.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -216,31 +216,27 @@ Inspector.prototype = {
   },
 
   /**
    * Figure out what features the backend supports
    */
   _detectActorFeatures: function () {
     this._supportsDuplicateNode = false;
     this._supportsScrollIntoView = false;
-    this._supportsResolveRelativeURL = false;
 
     // Use getActorDescription first so that all actorHasMethod calls use
     // a cached response from the server.
     return this._target.getActorDescription("domwalker").then(desc => {
       return promise.all([
         this._target.actorHasMethod("domwalker", "duplicateNode").then(value => {
           this._supportsDuplicateNode = value;
         }).catch(console.error),
         this._target.actorHasMethod("domnode", "scrollIntoView").then(value => {
           this._supportsScrollIntoView = value;
-        }).catch(console.error),
-        this._target.actorHasMethod("inspector", "resolveRelativeURL").then(value => {
-          this._supportsResolveRelativeURL = value;
-        }).catch(console.error),
+        }).catch(console.error)
       ]);
     });
   },
 
   _deferredOpen: async function (defaultSelection) {
     this.breadcrumbs = new HTMLBreadcrumbs(this);
 
     this.walker.on("new-root", this.onNewRoot);
@@ -1595,18 +1591,17 @@ Inspector.prototype = {
 
     // Get information about the right-clicked node.
     let popupNode = this.contextMenuTarget;
     if (!popupNode || !popupNode.classList.contains("link")) {
       return [linkFollow, linkCopy];
     }
 
     let type = popupNode.dataset.type;
-    if (this._supportsResolveRelativeURL &&
-        (type === "uri" || type === "cssresource" || type === "jsresource")) {
+    if ((type === "uri" || type === "cssresource" || type === "jsresource")) {
       // Links can't be opened in new tabs in the browser toolbox.
       if (type === "uri" && !this.target.chrome) {
         linkFollow.visible = true;
         linkFollow.label = INSPECTOR_L10N.getStr(
           "inspector.menu.openUrlInNewTab.label");
       } else if (type === "cssresource") {
         linkFollow.visible = true;
         linkFollow.label = TOOLBOX_L10N.getStr(
@@ -2122,18 +2117,16 @@ Inspector.prototype = {
    */
   followAttributeLink: function (type, link) {
     if (!type || !link) {
       return;
     }
 
     if (type === "uri" || type === "cssresource" || type === "jsresource") {
       // Open link in a new tab.
-      // When the inspector menu was setup on click (see _getNodeLinkMenuItems), we
-      // already checked that resolveRelativeURL existed.
       this.inspector.resolveRelativeURL(
         link, this.selection.nodeFront).then(url => {
           if (type === "uri") {
             let browserWin = this.target.tab.ownerDocument.defaultView;
             browserWin.openUILinkIn(url, "tab");
           } else if (type === "cssresource") {
             return this.toolbox.viewSourceInStyleEditor(url);
           } else if (type === "jsresource") {
@@ -2164,18 +2157,16 @@ Inspector.prototype = {
 
     this.copyAttributeLink(link);
   },
 
   /**
    * This method is here for the benefit of copying links.
    */
   copyAttributeLink: function (link) {
-    // When the inspector menu was setup on click (see _getNodeLinkMenuItems), we
-    // already checked that resolveRelativeURL existed.
     this.inspector.resolveRelativeURL(link, this.selection.nodeFront).then(url => {
       clipboardHelper.copyString(url);
     }, console.error);
   },
 
   /**
    * Returns an object containing the shared handler functions used in the box
    * model and grid React components.