Verified Commit 8cb5b58d authored by Gijs Kruitbosch's avatar Gijs Kruitbosch Committed by ma1
Browse files

Bug 1959298 - use search params in about:memory, r=mccr8

parent ecb10981
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -506,19 +506,11 @@ window.onload = function () {
  appendElementWithText(gFooter, "div", "legend", legendText1);
  appendElementWithText(gFooter, "div", "legend hiddenOnMobile", legendText2);

  // See if we're loading from a file.  (Because about:memory is a non-standard
  // URL, location.search is undefined, so we have to use location.href
  // instead.)
  let search = location.href.split("?")[1];
  if (search) {
    let searchSplit = search.split("&");
    for (let s of searchSplit) {
      if (s.toLowerCase().startsWith("file=")) {
        let filename = s.substring("file=".length);
        updateAboutMemoryFromFile(decodeURIComponent(filename));
        return;
      }
    }
  // See if we're loading from a file.
  let { searchParams } = URL.fromURI(document.documentURIObject);
  let fileParam = searchParams.get("file");
  if (fileParam) {
    updateAboutMemoryFromFile(fileParam);
  }
};