From c10f74ccd57fa0c5baab55997a8064da55c397bd Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 6 Feb 2016 09:50:02 -0500 Subject: [PATCH] make it easier to get screenshots of fully expanded popup panel --- src/css/popup.css | 3 +++ src/js/popup.js | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/css/popup.css b/src/css/popup.css index 330cd4fcb..3e0001b20 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -8,6 +8,9 @@ body { padding: 0; white-space: nowrap; } +body.fullsize { + overflow: auto; + } /** https://github.com/gorhill/uBlock/issues/83 .portrait = portrait mode = width is constrained = optimize layout accordingly. diff --git a/src/js/popup.js b/src/js/popup.js index 5fa84bbeb..2cb37b979 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -41,6 +41,12 @@ var dfPaneVisibleStored = vAPI.localStorage.getItem('popupFirewallPane') === 'tr // of the popup, and the left pane will have a scrollbar if ever its // height is more than what is available. (function() { + // No restriction on vertical size? + if ( /[\?&]fullsize=1/.test(window.location.search) ) { + document.body.classList.add('fullsize'); + return; + } + var rpane = document.querySelector('#panes > div:nth-of-type(1)'); if ( typeof rpane.offsetHeight === 'number' ) { document.querySelector('#panes > div:nth-of-type(2)').style.setProperty( @@ -697,7 +703,23 @@ var reloadTab = function() { /******************************************************************************/ -var toggleMinimize = function() { +var toggleMinimize = function(ev) { + // Special display mode: in its own tab/window, with no vertical restraint. + // Useful to take snapshots of the whole list of domains -- example: + // https://github.com/gorhill/uBlock/issues/736#issuecomment-178879944 + if ( ev.shiftKey && ev.ctrlKey ) { + messager.send({ + what: 'gotoURL', + details: { + url: 'popup.html?tabId=' + popupData.tabId + '&fullsize=1', + select: true, + index: -1 + } + }); + vAPI.closePopup(); + return; + } + popupData.firewallPaneMinimized = uDom.nodeFromId('firewallContainer') .classList .toggle('minimized');