Skip to content

Commit

Permalink
Bug 1477593 - fix about:networking on tier-3 platforms r=valentin
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Jan 7, 2020
1 parent 34bbecd commit 0a1bc6e
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions toolkit/content/aboutNetworking.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const gDirServ = Cc["@mozilla.org/file/directory_service;1"].getService(
);
const gNetLinkSvc = Cc[
"@mozilla.org/network/network-link-service;1"
] && Cc[
"@mozilla.org/network/network-link-service;1"
].getService(Ci.nsINetworkLinkService);

const gRequestNetworkingData = {
Expand Down Expand Up @@ -150,7 +152,10 @@ function displayWebsockets(data) {

function displayRcwnStats(data) {
let status = Services.prefs.getBoolPref("network.http.rcwn.enabled");
let linkType = gNetLinkSvc.linkType;
let linkType = Ci.nsINetworkLinkService.LINK_TYPE_UNKNOWN;
try {
linkType = gNetLinkSvc.linkType;
} catch (e) {}
if (
!(
linkType == Ci.nsINetworkLinkService.LINK_TYPE_UNKNOWN ||
Expand Down Expand Up @@ -194,13 +199,20 @@ function displayRcwnStats(data) {
}

function displayNetworkID() {
let linkIsUp = gNetLinkSvc.isLinkUp;
let linkStatusKnown = gNetLinkSvc.linkStatusKnown;
let networkID = gNetLinkSvc.networkID;

document.getElementById("networkid_isUp").innerText = linkIsUp;
document.getElementById("networkid_statusKnown").innerText = linkStatusKnown;
document.getElementById("networkid_id").innerText = networkID;
try {
let linkIsUp = gNetLinkSvc.isLinkUp;
let linkStatusKnown = gNetLinkSvc.linkStatusKnown;
let networkID = gNetLinkSvc.networkID;

document.getElementById("networkid_isUp").innerText = linkIsUp;
document.getElementById("networkid_statusKnown").innerText =
linkStatusKnown;
document.getElementById("networkid_id").innerText = networkID;
} catch (e) {
document.getElementById("networkid_isUp").innerText = "<unknown>";
document.getElementById("networkid_statusKnown").innerText = "<unknown>";
document.getElementById("networkid_id").innerText = "<unknown>";
}
}

function requestAllNetworkingData() {
Expand Down

0 comments on commit 0a1bc6e

Please sign in to comment.