chore: update project structure and enhance plugin functionality
- Added new entries to .gitignore for database files. - Updated go.mod and go.sum to include new indirect dependencies for database and ORM support. - Refactored event handling to improve message reply functionality in the protocol. - Enhanced the dispatcher to allow for better event processing and logging. - Removed outdated plugin documentation and unnecessary files to streamline the codebase. - Improved welcome message formatting and screenshot options for better user experience.
This commit is contained in:
@@ -74,6 +74,7 @@ func ScreenshotURL(ctx context.Context, url string, opts *ScreenshotOptions) (st
|
||||
var err error
|
||||
if opts.FullPage {
|
||||
err = chromedp.Run(ctx,
|
||||
chromedp.EmulateViewport(int64(opts.Width), int64(opts.Height)), // 设置视口大小
|
||||
chromedp.Navigate(url),
|
||||
chromedp.WaitReady("body", chromedp.ByQuery), // 使用 WaitReady 等待页面完全加载
|
||||
chromedp.Sleep(opts.WaitTime),
|
||||
@@ -156,6 +157,7 @@ func ScreenshotHTML(ctx context.Context, htmlContent string, opts *ScreenshotOpt
|
||||
opts.Logger.Debug("Taking full page screenshot")
|
||||
}
|
||||
err = chromedp.Run(ctx,
|
||||
chromedp.EmulateViewport(int64(opts.Width), int64(opts.Height)), // 设置视口大小
|
||||
chromedp.Navigate(dataURL),
|
||||
chromedp.WaitReady("body", chromedp.ByQuery),
|
||||
chromedp.Sleep(opts.WaitTime),
|
||||
@@ -166,6 +168,7 @@ func ScreenshotHTML(ctx context.Context, htmlContent string, opts *ScreenshotOpt
|
||||
opts.Logger.Debug("Taking viewport screenshot")
|
||||
}
|
||||
err = chromedp.Run(ctx,
|
||||
chromedp.EmulateViewport(int64(opts.Width), int64(opts.Height)), // 设置视口大小
|
||||
chromedp.Navigate(dataURL),
|
||||
chromedp.WaitReady("body", chromedp.ByQuery),
|
||||
chromedp.Sleep(opts.WaitTime),
|
||||
|
||||
Reference in New Issue
Block a user