DevTools - gcli - screenshot - the vertical mode

https://github.com/MoonchildProductions/moebius/pull/166
This commit is contained in:
janekptacijarabaci 2018-03-01 13:30:24 +01:00 committed by Roy Tam
commit 1a8810305a

View file

@ -277,6 +277,12 @@ function createScreenshotData(document, args) {
window.scrollTo(0,0);
width = window.innerWidth + window.scrollMaxX - window.scrollMinX;
height = window.innerHeight + window.scrollMaxY - window.scrollMinY;
let writingMode = "horizontal-tb";
if (window.getComputedStyle(document.documentElement)) {
writingMode = window.getComputedStyle(document.documentElement).writingMode;
}
let orientation = writingMode.substring(0, writingMode.indexOf("-")).toLowerCase();
left = ((orientation != "vertical") ? left : (-width + window.innerWidth));
filename = filename.replace(".png", "-fullpage.png");
}
else if (args.selector) {