From 2d741818abf98386fe17f5bda7e4930f1d6521b8 Mon Sep 17 00:00:00 2001 From: Nacho Date: Sat, 7 Jan 2023 23:00:30 +0100 Subject: [PATCH] Update v0.4.9 - Automatically download as landscape --- doc-viewer.js | 11 ++++++++++- manifest.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc-viewer.js b/doc-viewer.js index 30d2c15..95d8299 100644 --- a/doc-viewer.js +++ b/doc-viewer.js @@ -30,6 +30,15 @@ window.addEventListener('load', function(){ var tit = document.getElementsByTagName("h1")[0].innerHTML; var pages = document.getElementById('page-container').childNodes; + width = pages[0].offsetWidth; + height = pages[0].offsetHeight; + + if (width > height){ + print_opt = "{@page {size: A5 landscape;} body {zoom: 90%;}"; + }else{ + print_opt = "{@page {size: A5 portrait;}"; + } + for(i=0; i .nofilter{filter: none !important;} " + ""; + newWindow.document.getElementsByTagName("head")[0].innerHTML = head + "" + ""; newWindow.document.title = tit; newWindow.document.getElementsByTagName("body")[0].innerHTML = pdf; newWindow.document.getElementsByTagName("body")[0].childNodes[0].style = ""; diff --git a/manifest.json b/manifest.json index 19751d3..cecb049 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "StuHack", - "version": "0.4.8", + "version": "0.4.9", "description": "Banner remover, filter pass & document downloader", "icons": { "16": "img/icon16.png",