1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-06-17 00:07:55 +02:00

Moved html drivers outside of standard library

This commit is contained in:
Tim Voronov
2018-10-07 21:32:30 -04:00
parent 957490efec
commit 03d9f2e561
31 changed files with 40 additions and 42 deletions

View File

@ -1,11 +1,11 @@
package html
import (
"fmt"
"context"
"fmt"
"github.com/MontFerret/ferret/pkg/html/dynamic"
"github.com/MontFerret/ferret/pkg/runtime/values"
"github.com/MontFerret/ferret/pkg/stdlib/html/driver/dynamic"
"github.com/MontFerret/ferret/pkg/runtime/core"
)
@ -79,9 +79,9 @@ func Screenshot(ctx context.Context, args ...core.Value) (core.Value, error) {
}
if !dynamic.IsScreenshotFormatValid(format.String()) {
return values.None, core.Error(
core.ErrInvalidArgument,
core.ErrInvalidArgument,
fmt.Sprintf("format is not valid, expected jpeg or png, but got %s", format.String()))
}
}
screenshotParams.Format = dynamic.ScreenshotFormat(format.String())
}
x, found := params.Get("x")