From 08353865f4ae78898f6529e62e0db50d81507225 Mon Sep 17 00:00:00 2001 From: divinity76 Date: Fri, 4 Apr 2025 13:45:41 +0200 Subject: [PATCH] allow specifying options in screenshotElement --- src/Page.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Page.php b/src/Page.php index 3e7180e..fbb3fd4 100644 --- a/src/Page.php +++ b/src/Page.php @@ -691,11 +691,11 @@ public function screenshot(array $options = []): PageScreenshot return new PageScreenshot($responseReader); } - public function screenshotElement(Node $node): PageScreenshot + public function screenshotElement(Node $node, array $options = []): PageScreenshot { - return $this->screenshot([ - 'clip' => $node->getClip(), - ]); + // todo: invalidArgumentException if ['clip'] is already present? + $options['clip'] = $node->getClip(); + return $this->screenshot($options); } /**