String[] (@NotNull JCefAppConfig config, @NotNull CefSettings settings, @Nullable BoolRef doTrackGPUCrashes) { String[] argsFromProviders = JBCefAppRequiredArgumentsProvider .getProviders() .stream() .flatMap(p -> { LOG.debug("got options: [" + p.getOptions() + "] from:" + p.getClass().getName()); return p.getOptions().stream(); }) .distinct() .toArray(String[]::new); String[] args = ArrayUtil.mergeArrays(config.getAppArgs(), argsFromProviders); JBCefProxySettings proxySettings = JBCefProxySettings.getInstance(); String[] proxyArgs = null; if (proxySettings.USE_PROXY_PAC) { if (proxySettings.USE_PAC_URL) { proxyArgs = new String[] {"--proxy-pac-url=" + proxySettings.PAC_URL + ":" + proxySettings.PROXY_PORT}; } else { // when "Auto-detect proxy settings" proxy option is enabled in IntelliJ: // IntelliJ's behavior: use system proxy settings or an automatically detected the proxy auto-config (PAC) file // CEF's behavior : use system proxy settings // When no proxy flag passes to CEF, it uses the system proxy by default and detected the proxy auto-config (PAC) file // when "--proxy-auto-detect" flag passed. // CEF doesn't have any proxy flag that checks both system proxy settings and automatically detects proxy auto-config, // so we let the CEF uses the system proxy here because this is more useful for users and users can also manually // configure the PAC file in IntelliJ setting if they need to use PAC file. } } else if (proxySettings.USE_HTTP_PROXY) { String proxyScheme; if (proxySettings.PROXY_TYPE_IS_SOCKS) { proxyScheme = "socks"; } else { proxyScheme = "http"; } String proxyServer = "--proxy-server=" + proxyScheme + "://" + proxySettings.PROXY_HOST + ":" + proxySettings.PROXY_PORT; if (StringUtil.isEmptyOrSpaces(proxySettings.PROXY_EXCEPTIONS)) { proxyArgs = new String[]{proxyServer}; } else { String proxyBypassList = "--proxy-bypass-list=" + proxySettings.PROXY_EXCEPTIONS; proxyArgs = new String[]{proxyServer, proxyBypassList}; } } else { proxyArgs = new String[]{"--no-proxy-server"}; } if (proxyArgs != null) args = ArrayUtil.mergeArrays(args, proxyArgs); if (Registry.is("ide.browser.jcef.gpu.disable")) { // Add possibility to disable GPU (see IDEA-248140) args = ArrayUtil.mergeArrays(args, "--disable-gpu", "--disable-gpu-compositing"); } final boolean trackGPUCrashes = Registry.is("ide.browser.jcef.gpu.infinitecrash"); if (trackGPUCrashes) { args = ArrayUtil.mergeArrays(args, "--disable-gpu-process-crash-limit"); if (doTrackGPUCrashes != null) doTrackGPUCrashes.set(true); } // Sometimes it's useful to be able to pass any additional keys (see IDEA-248140) // NOTE: List of keys: https://peter.sh/experiments/chromium-command-line-switches/ String extraArgsProp = System.getProperty("ide.browser.jcef.extra.args", ""); if (!extraArgsProp.isEmpty()) { String[] extraArgs = extraArgsProp.split(","); if (extraArgs.length > 0) { LOG.debug("add extra CEF args: [" + Arrays.toString(extraArgs) + "]"); args = ArrayUtil.mergeArrays(args, extraArgs); } } if (settings.remote_debugging_port > 0) { args = ArrayUtil.mergeArrays(args, "--remote-allow-origins=*"); } return args; }