feat(chromium): add --chromium-disable-javascript property (fixes #175)

This commit is contained in:
Julien Neuhart
2021-11-22 18:41:21 +01:00
parent dd1e11f102
commit ee0debe14a
4 changed files with 47 additions and 0 deletions

View File

@@ -238,6 +238,7 @@ func TestChromium_PDF(t *testing.T) {
proxyServer string
allowList *regexp.Regexp
denyList *regexp.Regexp
disableJavaScript bool
expectErr bool
}{
{
@@ -256,6 +257,10 @@ func TestChromium_PDF(t *testing.T) {
UserAgent: "foo",
},
},
{
URL: "file:///tests/test/testdata/chromium/html/sample9/index.html",
disableJavaScript: true,
},
{
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
options: Options{
@@ -412,6 +417,7 @@ func TestChromium_PDF(t *testing.T) {
mod.allowList = tc.allowList
mod.denyList = tc.denyList
mod.disableJavaScript = tc.disableJavaScript
outputDir, err := gotenberg.MkdirAll()
if err != nil {