Skip to content

Commit

Permalink
Added encode/decode URL fix from 2ae6d55
Browse files Browse the repository at this point in the history
  • Loading branch information
twolfson committed Jun 18, 2019
1 parent 389b9c4 commit 8654a4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/electron-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ program.option('--user-data-dir [dir]', 'Directory to store user data');
program.option('--show', 'Boolean to make the window visible');
program.option('--extended-options [filepath]', 'Load extended options from file');
program.option('--default-user-agent', 'Boolean when spefified uses default user agent');
program.option('--url [url]', 'URL to load page at');
// DEV: We need to encode our URL to avoid issues with Electron on Windows
// https://ci.appveyor.com/project/twolfson/karma-electron-launcher/builds/25358540/job/k8q6ugas6ha0s7n5
program.option('--encoded-url [url]', 'URL to load page at');
program.option('--require [filepath]', 'Path to main process file to require');
program.allowUnknownOption();

Expand Down Expand Up @@ -98,5 +100,6 @@ async.parallel([
// Example: Electron 0.36.9 (Node.js 5.1.1)
loadURLOptions.userAgent = 'Electron ' + process.versions.electron + ' (Node ' + process.versions.node + ')';
}
browserWindow.loadURL(program.url, loadURLOptions);
console.log('mid5');
browserWindow.loadURL(decodeURIComponent(program.encodedUrl), loadURLOptions);
});
2 changes: 1 addition & 1 deletion lib/karma-electron-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function ElectronBrowser(baseBrowserDecorator, args, karmaBasePath, karmaUrlRoot
this._getOptions = function (url) {
var retArr = [__dirname + '/electron-launcher.js'].concat(flags, [
'--user-data-dir', userDataDir,
'--url', url
'--encoded-url', encodeURIComponent(url)
]);
if (args.require) { retArr = retArr.concat(['--require', args.require]); }
if (extendedOptions) {
Expand Down

0 comments on commit 8654a4a

Please sign in to comment.