Skip to content

Commit

Permalink
Add the "scroll_into_view_adjust_top" option
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Apr 8, 2024
1 parent ac08037 commit 5b261c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "screenshotone-api-sdk",
"homepage": "https://screenshotone.com",
"version": "1.1.9",
"version": "1.1.10",
"description": "Use ScreenshotOne.com API to generate screenshots of any website.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -47,4 +47,4 @@
"build": "tsc",
"prepare": "npm run build"
}
}
}
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,16 @@ export class TakeOptions {
return this;
}

/**
* After the given element appears in the viewport and its top coordinate is aligned with the viewport’s top,
* you can adjust the position a bit before taking a screenshot.
*/
scrollIntoViewAdjustTop(adjustTop: number): TakeOptions {
this.put("scroll_into_view_adjust_top", adjustTop.toString());

return this;
}

/**
* You can use your custom proxy to take screenshots
* or render HTML with the proxy option.
Expand Down

0 comments on commit 5b261c5

Please sign in to comment.