viewport-size-on-resize.js (988B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const { 8 ViewportSizeHighlighter, 9 } = require("resource://devtools/server/actors/highlighters/viewport-size.js"); 10 11 const HIDE_TIMEOUT_MS = Services.prefs.getIntPref( 12 "devtools.highlighter-viewport-size-timeout", 13 1000 14 ); 15 16 /** 17 * The ViewportSizeOnResizeHighlighter is a class that displays the viewport 18 * width and height when the viewport size resizes, even when the rulers are not displayed. 19 */ 20 class ViewportSizeOnResizeHighlighter extends ViewportSizeHighlighter { 21 constructor(highlighterEnv, parent) { 22 super(highlighterEnv, parent, { 23 extraCls: "viewport-size-on-resize-highlighter", 24 hideTimeout: HIDE_TIMEOUT_MS, 25 waitForDocumentToLoad: false, 26 }); 27 } 28 } 29 exports.ViewportSizeOnResizeHighlighter = ViewportSizeOnResizeHighlighter;