Skip to content

Commit

Permalink
3.0.4
Browse files Browse the repository at this point in the history
- remove extra http headers and useragent that would cause issues on some sites
  • Loading branch information
Osiris-Team committed Jun 18, 2024
1 parent bdba3ee commit 1c7da0a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.osiris.headlessbrowser</groupId>
<artifactId>Headless-Browser</artifactId>
<version>3.0.3</version>
<version>3.0.4</version>
<repositories>
<repository>
<id>jitpack</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ public PlaywrightWindow(HBrowser parentBrowser, boolean enableJavaScript, Output
//" downloadsPath: '" + downloadTempDir.getAbsolutePath().replace("\\", "/") + "',\n" + // Active issue at: https://github.com/microsoft/playwright/issues/9279
" devtools: " + isDevTools + ",\n" +
//" ignoreDefaultArgs: true,\n" +
" args: ['--disable-blink-features=AutomationControlled'],\n" + // '--enable-automation=false'
" extraHTTPHeaders: " + new GsonBuilder().setPrettyPrinting().create().toJson(new ChromeHeaders().getJson()) + ",\n" +
" userAgent: '" + new ChromeHeaders().user_agent + "'\n" + // Just to make sure...
" args: ['--disable-blink-features=AutomationControlled']\n" + // '--enable-automation=false'
"});\n" +
"browser = browserCtx.browser();\n" +
"page = await browserCtx.newPage();\n", 30, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ public PuppeteerWindow(HBrowser parentBrowser, boolean enableJavaScript, OutputS
jsInitCode.append("console.log(puppeteer.defaultArgs(defaultArgs));\n");
jsInitCode.append("browser = await puppeteer.launch(defaultArgs);\n");
jsInitCode.append("page = await browser.newPage();\n");
jsInitCode.append("await page.setExtraHTTPHeaders(" + new GsonBuilder().setPrettyPrinting().create().toJson(new ChromeHeaders().getJson()) + ");\n");
jsContext.executeJavaScript(jsInitCode.toString(), 30, false);
setEnableJavaScript(enableJavaScript);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

class PlaywrightWindowTest {

Expand Down

0 comments on commit 1c7da0a

Please sign in to comment.