Skip to content
This repository was archived by the owner on Aug 13, 2018. It is now read-only.

Commit f9b262e

Browse files
committed
#47 keep back compatibility
1 parent 1b981f6 commit f9b262e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

chrome/content/network-content-script.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@ window.on(EVENTS.RECEIVED_REQUEST_HEADERS, (event, from) => {
2323

2424
// Append WebSocket icon in the UI
2525
var hbox = item._target;
26-
var status = hbox.querySelector(".requests-menu-method");
27-
status.classList.add("websocket");
26+
27+
var method = hbox.querySelector(".requests-menu-method");
28+
method.classList.add("websocket");
29+
30+
// Fx 45 changed the DOM layout in the network panel and also
31+
// the WS icon isn't overlapping the original status icon now.
32+
// But, we need a little indentation for pre Fx45.
33+
var statusIconNode = hbox.querySelector(".requests-menu-status-icon");
34+
if (!statusIconNode) {
35+
// We are in pre Fx45 world, use a little indentation.
36+
method.classList.add("websocket-indent");
37+
}
2838

2939
// Register click handler and emit an event that is handled
3040
// in the 'WsmNetMonitorOverlay' overlay.

chrome/skin/classic/netmonitor.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
filter: url(./filters.svg#invert);
2121
}
2222

23+
/* The layout changed a bit in Fx45 and we need a little indentation
24+
* of the background image for prev Fx45. See network-content-script.js
25+
* for more details. */
26+
.requests-menu-method.websocket-indent {
27+
background-position: 24px 1px;
28+
}
29+
2330
.theme-firebug box.requests-menu-status.websocket {
2431
background-color: transparent !important;
2532
}

0 commit comments

Comments
 (0)