Skip to content

Commit

Permalink
Solving BiDi Issue with Incognito Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrhman-Ellithy committed Jan 3, 2025
1 parent 51d9563 commit cec46c8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ protected void setDriverOptions(DriverFactory.DriverType driverType, MutableCapa
}
//Incognito mode for Firefox
if (SHAFT.Properties.web.incognitoMode()) {
SHAFT.Properties.platform.set().enableBiDi(false);

Check warning on line 83 in src/main/java/com/shaft/driver/internal/DriverFactory/OptionsManager.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/shaft/driver/internal/DriverFactory/OptionsManager.java#L83

Added line #L83 was not covered by tests
ffOptions.addArguments("-private");
}
ffOptions.setLogLevel(FirefoxDriverLogLevel.WARN);
Expand Down Expand Up @@ -359,6 +360,7 @@ private ChromiumOptions<?> setupChromiumOptions(ChromiumOptions<?> options, Muta
if (!SHAFT.Properties.flags.autoCloseDriverInstance()) options.setExperimentalOption("detach", true);
//Incognito mode for Chrome and Edge
if (SHAFT.Properties.web.incognitoMode()) {
SHAFT.Properties.platform.set().enableBiDi(false);

Check warning on line 363 in src/main/java/com/shaft/driver/internal/DriverFactory/OptionsManager.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/shaft/driver/internal/DriverFactory/OptionsManager.java#L363

Added line #L363 was not covered by tests
if (options.getBrowserName().equals(DriverFactory.DriverType.CHROME.getValue())) {
options.addArguments("--incognito");
} else if (options.getBrowserName().equals(DriverFactory.DriverType.EDGE.getValue())) {
Expand Down Expand Up @@ -432,4 +434,4 @@ private LoggingPreferences configureLoggingPreferences() {
logPrefs.enable(LogType.DRIVER, java.util.logging.Level.ALL);
return logPrefs;
}
}
}

0 comments on commit cec46c8

Please sign in to comment.