Skip to content

Commit

Permalink
feat: migrate to latest chromium based edge
Browse files Browse the repository at this point in the history
BREAKING CHANGE: doesn't work with old MS Edge anymore.
  • Loading branch information
3cp committed Feb 18, 2020
1 parent 2a8fc38 commit b1a54c1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 67 deletions.
56 changes: 28 additions & 28 deletions lib/browsers/edge.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/* eslint-disable no-console */
// https://github.com/jslegers/karma-edge-launcher/blob/master/index.js
const getExe = require('../get-exe');
const tmp = require('tmp');
tmp.setGracefulCleanup();

const path = require('path');
const {execSync} = require('child_process');
module.exports = function() {
const tmpobj = tmp.dirSync({unsafeCleanup: true});

const backslashRegex = /\\/g;
const escapeBackslash = '\\\\';
const spaceRegex = / /g;
const escapeSpace = '` ';
const startScriptPath = path
.join(__dirname, 'start_edge.ps1')
.replace(backslashRegex, escapeBackslash)
.replace(spaceRegex, escapeSpace);

function killEdgeProcess() {
try {
execSync('taskkill /t /f /im MicrosoftEdge.exe');
} catch (err) {
console.error('Killing Edge process failed. ' + err);
return {
path: {
win32: getExe('Microsoft\\Edge\\Application\\msedge.exe')
},
args: [
'--user-data-dir=' + tmpobj.name,
// https://github.com/GoogleChrome/chrome-launcher/blob/master/docs/chrome-flags-for-tools.md#--enable-automation
'--enable-automation',
'--no-default-browser-check',
'--no-first-run',
'--disable-default-apps',
'--disable-popup-blocking',
'--disable-translate',
'--disable-background-timer-throttling',
// on macOS, disable-background-timer-throttling is not enough
// and we need disable-renderer-backgrounding too
// see https://github.com/karma-runner/karma-chrome-launcher/issues/123
'--disable-renderer-backgrounding',
'--disable-device-discovery-notifications'
],
onExit() {
tmpobj.removeCallback();
}
}
}

module.exports = {
path: {
win32: 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'
},
args: [
startScriptPath
],
onExit: killEdgeProcess
};
39 changes: 0 additions & 39 deletions lib/browsers/start_edge.ps1

This file was deleted.

0 comments on commit b1a54c1

Please sign in to comment.