Skip to content

feat: add Internet Explorer mode support for Edge browser #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cpiercedev
Copy link

@cpiercedev cpiercedev commented Aug 19, 2025

Adds support for IE Mode within Edge. Useful for legacy applications.

Summary by CodeRabbit

  • New Features

    • Added Microsoft Edge as a supported browser.
    • Introduced an IE mode option when launching Edge.
  • Documentation

    • Updated supported browsers list to include Edge.
    • Added docs for the new IE mode option.
    • Expanded Examples with Chrome and Edge (IE mode) payloads.
  • Chores

    • Bumped version to 0.1.22.

Copy link

coderabbitai bot commented Aug 19, 2025

Walkthrough

Adds explicit Microsoft Edge support with an optional IE mode to the Selenium-based launcher and public API. Updates the README to document Edge/IE mode usage, extends the browser options schema to include ieMode, and bumps the package version to 0.1.22.

Changes

Cohort / File(s) Summary of changes
Docs: Edge + IE mode
README.md
Documents Edge as a supported browser, adds ieMode option (Edge-only), updates start_browser schema examples with Chrome and Edge IE-mode payloads.
Versioning
package.json
Bumps version from 0.1.21 to 0.1.22.
Server: Edge/IE mode support
src/lib/server.js
Adds ieMode to browserOptionsSchema; introduces IEOptions import and Edge IE-mode launch path using IE driver with Edge Chromium attachment; preserves existing Chrome/Firefox/standard Edge flows; supports EDGE_PATH and IE command args.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant S as Server (start_browser)
  participant D as WebDriver
  participant IE as IE Driver (Edge IE mode)
  participant E as Edge Driver
  participant Ch as Chrome Driver
  participant F as Firefox Driver

  C->>S: start_browser({ browser, options })
  alt browser == "edge"
    alt options.ieMode == true
      Note over S,IE: Configure IEOptions with Edge Chromium attachment<br/>Apply Protected Mode, Zoom, EDGE_PATH, extra args
      S->>IE: Initialize IE Driver (Edge IE mode)
      IE-->>S: Session
    else options.ieMode == false
      Note over S,E: Configure EdgeOptions (incl. headless/args)
      S->>E: Initialize Edge Driver
      E-->>S: Session
    end
  else browser == "chrome"
    Note over S,Ch: Configure ChromeOptions (incl. headless/args)
    S->>Ch: Initialize Chrome Driver
    Ch-->>S: Session
  else browser == "firefox"
    Note over S,F: Configure FirefoxOptions (incl. headless/args)
    S->>F: Initialize Firefox Driver
    F-->>S: Session
  end
  S-->>C: Return session handle
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • angiejones

Poem

A rabbit boots up Edge with glee,
And whispers, “IE mode, follow me!”
Through Selenium fields we bound,
Old and new both safe and sound.
Version hops to .22—
Carrots, tabs, and paths anew. 🥕🖥️

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
package.json (1)

3-3: Version bump looks good; consider syncing the server’s advertised version.

package.json is now 0.1.22 while src/lib/server.js still advertises version "1.0.0" in the MCP banner. To avoid drift, read the version from package.json at runtime.

You can wire the server version to package.json like this (outside this file):

// src/lib/server.js (top-level imports)
import pkgJson from '../../package.json' assert { type: 'json' };

// ...
const server = new McpServer({
  name: "MCP Selenium",
  version: pkgJson.version
});

Optionally also declare supported Node versions to ensure ESM + top-level await + JSON import assertions are supported:

   "license": "ISC",
+  "engines": {
+    "node": ">=18.14"
+  },
   "dependencies": {
README.md (1)

132-134: Document IE mode prerequisites and constraints (Windows-only; no headless).

IE mode in Edge is Windows-only, uses IEDriver, and doesn’t support headless. Calling this out avoids confusion and fragile setups.

Apply the following doc additions near the ieMode property:

-    - `ieMode`: Enable Internet Explorer mode for Edge (Edge only)
-      - Type: boolean
+    - `ieMode`: Enable Internet Explorer mode for Edge (Edge only)
+      - Type: boolean
+      - Notes:
+        - Windows-only. Requires Microsoft Edge installed and IE Mode enabled via enterprise policy/registry.
+        - Headless is not supported in IE Mode; the `headless` option will be ignored if `ieMode` is true.
+        - You may need IEDriverServer available on PATH. If Edge is not in a default location, set `EDGE_PATH`
+          to the msedge.exe path (e.g., `C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe`).
src/lib/server.js (1)

50-52: Schema addition is fine; consider guarding misuse (ieMode on non-Edge).

ieMode is only meaningful when browser === 'edge'. Today misuse is silently ignored; add validation to surface configuration errors early.

Option A (runtime guard, minimal change; inside start_browser handler):

if (options.ieMode && browser !== 'edge') {
  throw new Error("The 'ieMode' option is only supported when browser is 'edge'.");
}

Option B (schema-level; larger change): use a discriminated union on browser so ieMode only appears for the edge branch and can disallow headless there.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9c1d066 and 16e50f4.

📒 Files selected for processing (3)
  • README.md (3 hunks)
  • package.json (1 hunks)
  • src/lib/server.js (3 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~125-~125: There might be a mistake here.
Context: ...options: Browser configuration options - Type: object - Properties: - `head...

(QB_NEW_EN)


[grammar] ~126-~126: There might be a mistake here.
Context: ...r configuration options - Type: object - Properties: - headless: Run browse...

(QB_NEW_EN)


[grammar] ~128-~128: There might be a mistake here.
Context: ...headless: Run browser in headless mode - Type: boolean - arguments: Additio...

(QB_NEW_EN)


[grammar] ~130-~130: There might be a mistake here.
Context: ...arguments: Additional browser arguments - Type: array of strings - ieMode`: E...

(QB_NEW_EN)


[grammar] ~132-~132: There might be a mistake here.
Context: ...ernet Explorer mode for Edge (Edge only) - Type: boolean Examples: Chrome bro...

(QB_NEW_EN)

🔇 Additional comments (5)
README.md (3)

34-34: Edge + IE mode addition reads well.

Clear and discoverable addition to the supported browsers list.


124-125: Enum update is consistent with the implementation.

Docs list "edge" which matches server.js (z.enum(["chrome","firefox","edge"])).


135-137: Examples section addition: good call.

Clear separation before Chrome/Edge samples.

src/lib/server.js (2)

106-118: Regular Edge path: LGTM; headless/new flag is appropriate.

Arguments and headless handling mirror the Chrome/Firefox flows and look correct.


11-11: IEOptions import compatibility confirmed

The ESM import

import { Options as IEOptions } from 'selenium-webdriver/ie.js';

is valid in selenium-webdriver@^4.18.1 and the Options class includes the methods
setEdgeChromium, setEdgePath, ignoreZoomSetting, and introduceFlakinessByIgnoringProtectedModeSettings. No changes needed.

Comment on lines +151 to +164
Edge with Internet Explorer mode (most important feature):
```json
{
"tool": "start_browser",
"parameters": {
"browser": "edge",
"options": {
"ieMode": true,
"arguments": ["--disable-web-security"]
}
}
}
```

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Tighten the Edge IE mode example; clarify args and env var usage.

  • Chromium flags like --disable-web-security may not be honored under IE mode. Prefer showing an Edge-relevant flag (e.g., --inprivate) or omit arguments to avoid implying support.
  • Include the EDGE_PATH example to help users whose Edge isn’t in a default location.
  • Explicitly state that headless is ignored in IE mode.
-Edge with Internet Explorer mode (most important feature):
+Edge with Internet Explorer mode:
 ```json
 {
   "tool": "start_browser",
   "parameters": {
     "browser": "edge",
     "options": {
       "ieMode": true,
-      "arguments": ["--disable-web-security"]
+      "arguments": ["--inprivate"]
     }
   }
 }

+Prerequisites:
+- Windows-only. Ensure IE Mode is enabled for Edge via enterprise policy/registry.
+- IEDriverServer should be available on PATH.
+- If Edge is not in a default location, set the environment variable before launching:

    • Windows PowerShell: $env:EDGE_PATH="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
      +- Headless is not supported in IE mode; any headless option will be ignored.

---

🌐 Web query:

```web
In Selenium WebDriver for Node.js (selenium-webdriver package), what is the correct API to pass command-line arguments to Edge when using InternetExplorer Options with `setEdgeChromium(true)` (IE mode)? Is `addBrowserCommandSwitches` available on `selenium-webdriver/ie` Options, or should `ie.edgeargs` be set via capabilities?

💡 Result:

Short answer

  • addBrowserCommandSwitches exists on selenium-webdriver/ie Options (it sets ie.browserCommandLineSwitches) — but it is for launching Internet Explorer (CreateProcess API) and is not an API to pass command‑line args into the Chromium Edge process when using IE‑mode.
  • There is no documented ie.edgeargs option on selenium-webdriver/ie Options. If you need to pass arguments to Edge itself, do that with EdgeOptions (ms:edgeOptions / EdgeOptions.args) when starting Edge with EdgeDriver, or use a wrapper/executable specified via the IE option that points Edge to a binary launched with the desired flags. The IE driver supports ie.edgepath/ie.edgechromium to attach to Edge, but not a direct ie.edgeargs option. (selenium.dev, learn.microsoft.com)

Details / recommended approaches

  • The Node.js IE Options class exposes addBrowserCommandSwitches(...) (and the deprecated addArguments(...)) which set the IE capability ie.browserCommandLineSwitches. Those switches are intended for Internet Explorer itself (used when forceCreateProcessApi is enabled). (selenium.dev)
  • The IE/IEDriver support for automating IE‑mode in Edge is limited to flags such as ie.edgechromium (attachToEdgeChrome) and ie.edgepath (Edge executable path). Microsoft’s IE‑mode docs show AttachToEdgeChrome / EdgeExecutablePath but don’t document an ie.edgeargs capability. (learn.microsoft.com)
  • Edge/Chromium accepts command‑line args via ms:edgeOptions (EdgeOptions.args / ms:edgeOptions.args). That is the documented place to pass Chromium flags — but that applies when you launch Edge with EdgeDriver, not when IE Driver launches Edge in IE‑mode. If you can run Edge directly under EdgeDriver, use EdgeOptions to pass args. (learn.microsoft.com)

Workarounds if you must use IEDriver + IE‑mode and need Edge args

  • Put a small wrapper executable or script as the value for the IE option that points to Edge (ie.edgepath / EdgeExecutablePath) which launches msedge.exe with the desired command‑line switches.
  • Or, if possible, switch to launching Edge directly with EdgeDriver and supply ms:edgeOptions.args via EdgeOptions (clean and supported).
  • If you believe you need native support for passing Edge args via IEDriver, consider filing an issue with the IEDriver / Selenium projects or checking the IEDriver release notes for later additions.

If you want, tell me which exact flags you need to pass and whether you must use IE‑mode via IEDriver or can launch Edge directly — I can show the exact code for the appropriate approach (IE Options + wrapper or EdgeOptions with ms:edgeOptions.args).

Citations:


Remove unsupported arguments in IE mode; clarify no Edge flags are passed

The IE-mode snippet in README.md currently suggests passing Chromium flags via the IE Options arguments field—but IEDriver’s IE-mode support (setEdgeChromium/ie.edgechromium) does not honor any arguments or ie.edgeargs. Instead:

• Remove the "arguments": […] line entirely (or replace it with a comment stating that args are ignored).
• If you truly need to launch Edge in IE-mode with extra flags (e.g. --inprivate), you must either:
– Launch Edge directly via EdgeDriver with EdgeOptions (ms:edgeOptions.args), or
– Point ie.edgepath (EdgeExecutablePath) to a wrapper script/executable that invokes Edge with the desired switches.
• Add an EDGE_PATH example for non-default installs.
• Clearly note that headless is ignored in IE-mode and that IE-mode requires Windows + enterprise policy/registry.

Pinpointed location:
• README.md, lines 151–164

Suggested diff:

 Edge with Internet Explorer mode:
 {
   "tool": "start_browser",
   "parameters": {
     "browser": "edge",
     "options": {
       "ieMode": true,
-      "arguments": ["--disable-web-security"]
+      // IE-mode via IEDriver does not support Chromium args
     }
   }
 }
 
 Prerequisites:
 - Windows only; IE Mode enabled for Edge via enterprise policy/registry.
 - IEDriverServer on PATH.
 - If Edge isn’t in the default location, set:
     PowerShell: $env:EDGE_PATH="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
 - Headless is ignored in IE mode.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Edge with Internet Explorer mode (most important feature):
```json
{
"tool": "start_browser",
"parameters": {
"browser": "edge",
"options": {
"ieMode": true,
"arguments": ["--disable-web-security"]
}
}
}
```
Edge with Internet Explorer mode:
{
"tool": "start_browser",
"parameters": {
"browser": "edge",
"options": {
"ieMode": true,
// IE-mode via IEDriver does not support Chromium args
}
}
}
🤖 Prompt for AI Agents
In README.md around lines 151 to 164, the IE-mode example incorrectly shows
passing Chromium flags via the IE Options "arguments" field; remove the
"arguments" line (or replace it with a one-line comment that IE-mode ignores
arguments/ie.edgeargs), add guidance that to pass Edge flags you must either
launch Edge directly via EdgeDriver with EdgeOptions (ms:edgeOptions.args) or
point ie.edgepath to a wrapper/executable that launches Edge with the desired
switches, include an example/mention of EDGE_PATH for non-default Edge installs,
and add a clear note that headless is ignored in IE-mode and that IE-mode
requires Windows plus enterprise policy/registry configuration.

Comment on lines +88 to +105
if (options.ieMode) {
// For IE mode, use IE driver with Edge Chromium attachment
const ieOptions = new IEOptions();
ieOptions.setEdgeChromium(true);
// Fix Protected Mode settings error
ieOptions.introduceFlakinessByIgnoringProtectedModeSettings(true);
ieOptions.ignoreZoomSetting(true);
if (process.env.EDGE_PATH) {
ieOptions.setEdgePath(process.env.EDGE_PATH);
}
if (options.arguments) {
options.arguments.forEach(arg => ieOptions.addBrowserCommandSwitches(arg));
}
driver = await builder
.forBrowser('internet explorer')
.setIeOptions(ieOptions)
.build();
} else {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

IE mode branch: add OS/headless guards; verify argument API.

  • IE mode is Windows-only. Add a guard to fail fast on non-Windows.
  • Headless is not supported; explicitly ignore or reject headless when ieMode is true.
  • Double-check whether addBrowserCommandSwitches is the correct API for passing Edge args in IE mode; some setups require setting the ie.edgeargs capability instead.

Apply these safety checks:

                 case 'edge': {
-                    if (options.ieMode) {
+                    if (options.ieMode) {
+                        if (process.platform !== 'win32') {
+                            throw new Error('Edge IE mode is only supported on Windows.');
+                        }
+                        if (options.headless) {
+                            console.warn('Ignoring headless option: IE mode does not support headless.');
+                        }
                         // For IE mode, use IE driver with Edge Chromium attachment
                         const ieOptions = new IEOptions();
                         ieOptions.setEdgeChromium(true);
                         // Fix Protected Mode settings error
                         ieOptions.introduceFlakinessByIgnoringProtectedModeSettings(true);
                         ieOptions.ignoreZoomSetting(true);
                         if (process.env.EDGE_PATH) {
                             ieOptions.setEdgePath(process.env.EDGE_PATH);
                         }
-                        if (options.arguments) {
-                            options.arguments.forEach(arg => ieOptions.addBrowserCommandSwitches(arg));
-                        }
+                        // NOTE: Verify the correct API for passing Edge args in IE mode.
+                        // Some environments require setting 'ie.edgeargs' capability.
+                        if (options.arguments?.length) {
+                            try {
+                                // If supported by current selenium-webdriver version:
+                                options.arguments.forEach(arg => ieOptions.addBrowserCommandSwitches(arg));
+                            } catch {
+                                // Fallback: set capability used by IEDriver to pass args to Edge
+                                ieOptions.set('ie.edgeargs', options.arguments);
+                            }
+                        }
                         driver = await builder
                             .forBrowser('internet explorer')
                             .setIeOptions(ieOptions)
                             .build();
                     } else {

🌐 Web query:

For Node selenium-webdriver IE Options, what is the supported way to supply Edge command-line args when `setEdgeChromium(true)` is used? Is `addBrowserCommandSwitches` the correct method name, or should `ie.edgeargs` be provided as a capability?

💡 Result:

Short answer: neither. addBrowserCommandSwitches (aka addArguments) is for Internet Explorer (when using the CreateProcess API) and won’t set Chromium/Edge command‑line flags. There is no documented selenium capability named ie.edgeargs. If you need to pass command‑line args to Edge, do it via EdgeOptions (ms:edgeOptions / EdgeOptions.args or webviewOptions.additionalBrowserArguments for WebView2) when launching EdgeDriver — you cannot inject normal Edge CLI args through the IE Options API used by setEdgeChromium(true).

Why:

  • The IE Options API exposes addBrowserCommandSwitches / ie.browserCommandLineSwitches for IE process switches (used with forceCreateProcessApi). (selenium.dev)
  • The IE‑mode/IEDriver documentation only documents enabling attachToEdgeChrome (ie.edgechromium / ie.edgepath) to tell IEDriver to start Edge in IE mode; it does not document passing Edge CLI args via se:ieOptions. (learn.microsoft.com, selenium.dev)
  • Edge/Chromium flags are supported via EdgeOptions (ms:edgeOptions args or webviewOptions.additionalBrowserArguments for WebView2). Use EdgeOptions.addArguments or set the ms:edgeOptions.args capability when launching EdgeDriver. (selenium.dev, learn.microsoft.com)

What to do instead

  • If you control starting Edge yourself: launch Edge via EdgeDriver and pass args with EdgeOptions (Node example):
  • If you must use IEDriver.attachToEdgeChrome (IE mode): there is no supported IE Options setting to pass arbitrary Edge CLI switches — you’ll need an alternate approach (launch Edge with desired args yourself and attach, use EdgeDriver, or configure the Edge/WebView2 runtime via its own configuration).

If you want, tell me which exact flags you need to set and whether you're using IEDriver (IE mode) or EdgeDriver — I can show the exact Node code (EdgeOptions vs IE Options) and a recommended workaround if you must stay on IE mode.

Citations:


Enforce Windows-only and drop unsupported Edge args in IE mode

  • Fail fast on non-Windows platforms
  • Warn and ignore headless when ieMode is true
  • Drop the attempt to pass options.arguments via IEOptions—Edge CLI flags aren’t supported through the IE Options API
                 case 'edge': {
-                    if (options.ieMode) {
+                    if (options.ieMode) {
+                        if (process.platform !== 'win32') {
+                            throw new Error('IE mode is only supported on Windows.');
+                        }
+                        if (options.headless) {
+                            console.warn('Ignoring headless option: IE mode does not support headless.');
+                        }
                         // For IE mode, use IE driver with Edge Chromium attachment
                         const ieOptions = new IEOptions();
                         ieOptions.setEdgeChromium(true);
                         // Fix Protected Mode settings error
                         ieOptions.introduceFlakinessByIgnoringProtectedModeSettings(true);
                         ieOptions.ignoreZoomSetting(true);
                         if (process.env.EDGE_PATH) {
                             ieOptions.setEdgePath(process.env.EDGE_PATH);
                         }
-                        // NOTE: Verify the correct API for passing Edge args in IE mode.
-                        // Some environments require setting 'ie.edgeargs' capability.
-                        if (options.arguments?.length) {
-                            try {
-                                // If supported by current selenium-webdriver version:
-                                options.arguments.forEach(arg => ieOptions.addBrowserCommandSwitches(arg));
-                            } catch {
-                                // Fallback: set capability used by IEDriver to pass args to Edge
-                                ieOptions.set('ie.edgeargs', options.arguments);
-                            }
-                        }
+                        if (options.arguments?.length) {
+                            console.warn(
+                                'Edge CLI arguments are not supported via IEOptions and will be ignored. ' +
+                                'To pass Edge flags, launch EdgeDriver directly with EdgeOptions.'
+                            );
+                        }
                         driver = await builder
                             .forBrowser('internet explorer')
                             .setIeOptions(ieOptions)
                             .build();
                     } else {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (options.ieMode) {
// For IE mode, use IE driver with Edge Chromium attachment
const ieOptions = new IEOptions();
ieOptions.setEdgeChromium(true);
// Fix Protected Mode settings error
ieOptions.introduceFlakinessByIgnoringProtectedModeSettings(true);
ieOptions.ignoreZoomSetting(true);
if (process.env.EDGE_PATH) {
ieOptions.setEdgePath(process.env.EDGE_PATH);
}
if (options.arguments) {
options.arguments.forEach(arg => ieOptions.addBrowserCommandSwitches(arg));
}
driver = await builder
.forBrowser('internet explorer')
.setIeOptions(ieOptions)
.build();
} else {
case 'edge': {
if (options.ieMode) {
if (process.platform !== 'win32') {
throw new Error('IE mode is only supported on Windows.');
}
if (options.headless) {
console.warn('Ignoring headless option: IE mode does not support headless.');
}
// For IE mode, use IE driver with Edge Chromium attachment
const ieOptions = new IEOptions();
ieOptions.setEdgeChromium(true);
// Fix Protected Mode settings error
ieOptions.introduceFlakinessByIgnoringProtectedModeSettings(true);
ieOptions.ignoreZoomSetting(true);
if (process.env.EDGE_PATH) {
ieOptions.setEdgePath(process.env.EDGE_PATH);
}
if (options.arguments?.length) {
console.warn(
'Edge CLI arguments are not supported via IEOptions and will be ignored. ' +
'To pass Edge flags, launch EdgeDriver directly with EdgeOptions.'
);
}
driver = await builder
.forBrowser('internet explorer')
.setIeOptions(ieOptions)
.build();
} else {
// ...
🤖 Prompt for AI Agents
In src/lib/server.js around lines 88 to 105, enforce Windows-only for IE mode by
checking process.platform and throwing an error if not 'win32', remove the loop
that attempts to pass options.arguments into IEOptions (Edge CLI flags are
unsupported via the IEOptions API) and instead log a warning when
options.arguments is present, and if options.headless (or any headless flag) is
set while ieMode is true log a warning that headless is ignored; keep the
existing IEOptions configuration for Edge Chromium attachment and protected
mode/zoom settings but fail fast on non-Windows, drop adding browser CLI
switches to IEOptions, and emit warnings for ignored headless/arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants