Skip to content

Commit

Permalink
feat: support 64-bit IE and isolate environment.
Browse files Browse the repository at this point in the history
This patch tries to auto-detect 64-bit IE by checking
for the appropriate environment variables. It also
improves reliability of the tests by disabling
extensions

Closes #1
  • Loading branch information
Christopher Currie authored and vojtajina committed Mar 4, 2014
1 parent 7b4bb72 commit c75ed34
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
var IEBrowser = function(baseBrowserDecorator) {
var fs = require('fs');

var IEBrowser = function(baseBrowserDecorator, args) {
baseBrowserDecorator(this);

args = args || {};
var flags = args.flags || [];

this._getOptions = function(url) {
return [
'-extoff'
].concat(flags, [url]);
}
};

function getInternetExplorerExe() {
var suffix = '\\Internet Explorer\\iexplore.exe',
prefixes = [process.env['PROGRAMW6432'], process.env['PROGRAMFILES(X86)'], process.env['PROGRAMFILES']],
prefix, i;

for (i = 0; i < prefixes.length; i++) {
prefix = prefixes[i];
if (prefix && fs.existsSync(prefix + suffix)) {
return prefix + suffix;
}
}

throw new Error("Internet Explorer not found");
}

IEBrowser.prototype = {
name: 'IE',
DEFAULT_CMD: {
win32: process.env.ProgramFiles + '\\Internet Explorer\\iexplore.exe'
win32: getInternetExplorerExe()
},
ENV_CMD: 'IE_BIN'
};
Expand Down

0 comments on commit c75ed34

Please sign in to comment.