Bug 1500068 - Avoid opening Add-ons panel when a location hash is passed to select another one. r=jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 18 Oct 2018 12:36:35 +0000
changeset 442118 14a6f6ecebc25ee188d852a4b12ed3befba3580a
parent 442117 33e352068e35a538ff380ef30749e53946c5bdd3
child 442119 0927741e9110eebe9d55a73f97fd8bb47f2d6bff
push id34890
push userdvarga@mozilla.com
push dateSat, 20 Oct 2018 09:40:11 +0000
treeherdermozilla-central@d0f1450799b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1500068
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1500068 - Avoid opening Add-ons panel when a location hash is passed to select another one. r=jdescottes Doing this avoid loading the addons panel and doing its related requests, which may still be pending after closing about:debugging. MozReview-Commit-ID: LJjaE5YVgXi Depends on D8867 Differential Revision: https://phabricator.services.mozilla.com/D8868
devtools/client/aboutdebugging/components/Aboutdebugging.js
--- a/devtools/client/aboutdebugging/components/Aboutdebugging.js
+++ b/devtools/client/aboutdebugging/components/Aboutdebugging.js
@@ -55,26 +55,25 @@ class AboutDebuggingApp extends Componen
       telemetry: PropTypes.instanceOf(Telemetry).isRequired
     };
   }
 
   constructor(props) {
     super(props);
 
     this.state = {
-      selectedPanelId: defaultPanelId
+      selectedPanelId: window.location.hash.substr(1) || defaultPanelId
     };
 
     this.onHashChange = this.onHashChange.bind(this);
     this.selectPanel = this.selectPanel.bind(this);
   }
 
   componentDidMount() {
     window.addEventListener("hashchange", this.onHashChange);
-    this.onHashChange();
 
     // aboutdebugging is not connected with a toolbox so we pass -1 as the
     // toolbox session id.
     this.props.telemetry.toolOpened("aboutdebugging", -1, this);
   }
 
   componentWillUnmount() {
     window.removeEventListener("hashchange", this.onHashChange);