Skip to content

Commit

Permalink
Set max-width on injected bounding box
Browse files Browse the repository at this point in the history
Otherwise, the box is too small if the page's CSS applies to the injected
element by accident (e.g., `body > * { max-width: 5cm; }`).
  • Loading branch information
kljohann committed Feb 13, 2024
1 parent f358ebd commit 1dc9eb6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions shot_scraper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 1dc9eb6

Please sign in to comment.