From 278fda2eb45d412b7dddd3d01d5cc8674ba79aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johann=20Kl=C3=A4hn?= Date: Sat, 9 Mar 2024 20:12:21 +0100 Subject: [PATCH] Set `max-width` on injected bounding box (#143) Otherwise, the box is too small if the page's CSS applies to the injected element by accident (e.g., `body > * { max-width: 5cm; }`). --- shot_scraper/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/shot_scraper/cli.py b/shot_scraper/cli.py index 936b505..3f1245e 100644 --- a/shot_scraper/cli.py +++ b/shot_scraper/cli.py @@ -1305,6 +1305,7 @@ def _selector_javascript(selectors, selectors_all, padding=0): div.style.left = left + 'px'; div.style.width = (right - left) + 'px'; div.style.height = (bottom - top) + 'px'; + div.style.maxWidth = 'none'; div.setAttribute('id', %s); document.body.appendChild(div); setTimeout(() => {