-
Notifications
You must be signed in to change notification settings - Fork 5
fix(frontend): screen shot not trigger #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ae36f6d
Dont need to wait for screenshot taking
ZHallen122 843415d
show top of the image
ZHallen122 11c53c8
take full screen and wait for 1 second to let the screen shot success
ZHallen122 f4a8190
[autofix.ci] apply automated fixes
autofix-ci[bot] f59d9fd
Merge branch 'main' into Fix-screen-shot-not-trigger
ZHallen122 a99ad47
[autofix.ci] apply automated fixes
autofix-ci[bot] bcdf4e6
smaller size
ZHallen122 dc6a6b8
set 2 second make sure get final picture
ZHallen122 3f3ce44
Merge branch 'main' into Fix-screen-shot-not-trigger
ZHallen122 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,8 @@ export async function GET(req: Request) { | |
|
||
// Set viewport to a reasonable size | ||
await page.setViewport({ | ||
width: 1280, | ||
height: 720, | ||
width: 1920, | ||
height: 1080, | ||
}); | ||
|
||
// Navigate to URL with increased timeout and more reliable wait condition | ||
|
@@ -49,10 +49,12 @@ export async function GET(req: Request) { | |
timeout: 60000, // Increased timeout to 60 seconds | ||
}); | ||
|
||
await new Promise((resolve) => setTimeout(resolve, 1000)); // Waits for 1 seconds | ||
|
||
// Take screenshot | ||
const screenshot = await page.screenshot({ | ||
type: 'png', | ||
fullPage: false, | ||
fullPage: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should not take full page screen shot, it will be tooo long for some SPA |
||
}); | ||
|
||
// Always close the page when done | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary for correctly taking screenshot?