Skip to content

Commit

Permalink
fix: Puppeteer Axe runner was crashing on file:// iframe origin 'null…
Browse files Browse the repository at this point in the history
…' check (Electron runner was not affected by this Axe-caused regression, due to using an HTTP server internally). This commit also updates NPM package dependencies, notably Electron v14 ( Fixes #358 )
  • Loading branch information
danielweck committed Sep 14, 2021
1 parent b512eed commit 5a4844a
Show file tree
Hide file tree
Showing 25 changed files with 522 additions and 519 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "4.0.0",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"npmClient": "yarn",
"useWorkspaces": true
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"workspaces": [
"packages/*"
],
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
"npm": ">=6.0.0"
},
"devDependencies": {
"@daisy/jest-env-puppeteer": "^1.2.4-alpha.1",
"@daisy/jest-puppeteer": "^1.2.4-alpha.1",
"@daisy/jest-env-puppeteer": "^1.2.4",
"@daisy/jest-puppeteer": "^1.2.4",
"@jest-runner/electron": "^3.0.1",
"babel-core": "^6.26.3",
"babel-jest": "^26.6.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/ace-axe-runner-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-axe-runner-electron",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,14 +23,14 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-cli-shared": "^1.2.4-alpha.1",
"@daisy/ace-cli-shared": "^1.2.4",
"express": "^4.17.1",
"portfinder": "^1.0.28",
"selfsigned": "^1.10.11",
"uuid": "^8.3.2"
},
"devDependencies": {
"electron": "^13.2.3",
"electron": "^14.0.1",
"json": "^11.0.0",
"json-diff": "^0.5.4"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/ace-axe-runner-electron/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const app = electron.app;

// Removes the deprecation warning message in the console
// https://github.com/electron/electron/issues/18397
app.allowRendererProcessReuse = true;
// app.allowRendererProcessReuse = true;
// https://www.electronjs.org/releases/stable#breaking-changes-1400

const EventEmitter = require('events');
class ElectronMockMainRendererEmitter extends EventEmitter {}
Expand Down Expand Up @@ -46,6 +47,7 @@ app.on('ready', async () => {
// sandbox: false,
// webSecurity: true,
// webviewTag: false,
// nativeWindowOpen: false, // The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15. See https://github.com/electron/electron/issues/28511
// }
// }
// );
Expand Down
3 changes: 2 additions & 1 deletion packages/ace-axe-runner-electron/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ function axeRunnerInit(eventEmmitter, CONCURRENT_INSTANCES) {
webSecurity: true,
webviewTag: false,
enableRemoteModule: false,
partition: SESSION_PARTITION
partition: SESSION_PARTITION,
nativeWindowOpen: false, // The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15. See https://github.com/electron/electron/issues/28511
},
});

Expand Down
4 changes: 2 additions & 2 deletions packages/ace-axe-runner-puppeteer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-axe-runner-puppeteer",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,7 +23,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/puppeteer-utils": "^1.2.4-alpha.1",
"@daisy/puppeteer-utils": "^1.2.4",
"puppeteer": "^10.2.0"
},
"publishConfig": {
Expand Down
10 changes: 5 additions & 5 deletions packages/ace-cli-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-cli-shared",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,10 +23,10 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-config": "^1.2.4-alpha.1",
"@daisy/ace-core": "^1.2.4-alpha.1",
"@daisy/ace-logger": "^1.2.4-alpha.1",
"@daisy/ace-meta": "^1.2.4-alpha.1",
"@daisy/ace-config": "^1.2.4",
"@daisy/ace-core": "^1.2.4",
"@daisy/ace-logger": "^1.2.4",
"@daisy/ace-meta": "^1.2.4",
"meow": "^9.0.0",
"winston": "^3.3.3"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/ace-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-cli",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -24,8 +24,8 @@
"main": "lib/index.js",
"bin": "bin/ace.js",
"dependencies": {
"@daisy/ace-axe-runner-puppeteer": "^1.2.4-alpha.1",
"@daisy/ace-cli-shared": "^1.2.4-alpha.1"
"@daisy/ace-axe-runner-puppeteer": "^1.2.4",
"@daisy/ace-cli-shared": "^1.2.4"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-config",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/ace-core-legacy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ace-core",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand Down Expand Up @@ -38,9 +38,9 @@
},
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-cli": "^1.2.4-alpha.1",
"@daisy/ace-core": "^1.2.4-alpha.1",
"@daisy/ace-http": "^1.2.4-alpha.1"
"@daisy/ace-cli": "^1.2.4",
"@daisy/ace-core": "^1.2.4",
"@daisy/ace-http": "^1.2.4"
},
"publishConfig": {
"access": "public"
Expand Down
16 changes: 8 additions & 8 deletions packages/ace-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-core",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,13 +23,13 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-localize": "^1.2.4-alpha.1",
"@daisy/ace-logger": "^1.2.4-alpha.1",
"@daisy/ace-meta": "^1.2.4-alpha.1",
"@daisy/ace-report": "^1.2.4-alpha.1",
"@daisy/ace-report-axe": "^1.2.4-alpha.1",
"@daisy/epub-utils": "^1.2.4-alpha.1",
"@daisy/axe-core-for-ace": "4.3.3-canary.1",
"@daisy/ace-localize": "^1.2.4",
"@daisy/ace-logger": "^1.2.4",
"@daisy/ace-meta": "^1.2.4",
"@daisy/ace-report": "^1.2.4",
"@daisy/ace-report-axe": "^1.2.4",
"@daisy/epub-utils": "^1.2.4",
"@daisy/axe-core-for-ace": "4.3.3-canary.2",
"file-url": "^3.0.0",
"h5o": "^0.11.3",
"p-map": "^4.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/ace-http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-http",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -24,10 +24,10 @@
"main": "lib/index.js",
"bin": "bin/ace-http.js",
"dependencies": {
"@daisy/ace-axe-runner-puppeteer": "^1.2.4-alpha.1",
"@daisy/ace-core": "^1.2.4-alpha.1",
"@daisy/ace-logger": "^1.2.4-alpha.1",
"@daisy/ace-meta": "^1.2.4-alpha.1",
"@daisy/ace-axe-runner-puppeteer": "^1.2.4",
"@daisy/ace-core": "^1.2.4",
"@daisy/ace-logger": "^1.2.4",
"@daisy/ace-meta": "^1.2.4",
"express": "^4.17.1",
"express-easy-zip": "^1.1.5",
"meow": "^9.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-localize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-localize",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,7 +23,7 @@
"license": "MIT",
"main": "lib/localize.js",
"dependencies": {
"i18next": "^20.4.0",
"i18next": "^20.6.1",
"winston": "^3.3.3"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ace-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-logger",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,7 +23,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-config": "^1.2.4-alpha.1",
"@daisy/ace-config": "^1.2.4",
"fs-extra": "^10.0.0",
"uuid": "^8.3.2",
"winston": "^3.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/ace-meta/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-meta",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/ace-report-axe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-report-axe",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,8 +23,8 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-localize": "^1.2.4-alpha.1",
"@daisy/ace-report": "^1.2.4-alpha.1",
"@daisy/ace-localize": "^1.2.4",
"@daisy/ace-report": "^1.2.4",
"fs-extra": "^10.0.0",
"winston": "^3.3.3"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/ace-report/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace-report",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,9 +23,9 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-config": "^1.2.4-alpha.1",
"@daisy/ace-localize": "^1.2.4-alpha.1",
"@daisy/ace-meta": "^1.2.4-alpha.1",
"@daisy/ace-config": "^1.2.4",
"@daisy/ace-localize": "^1.2.4",
"@daisy/ace-meta": "^1.2.4",
"escape-html": "^1.0.3",
"fs-extra": "^10.0.0",
"handlebars": "^4.7.7",
Expand Down
10 changes: 5 additions & 5 deletions packages/ace/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/ace",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand Down Expand Up @@ -39,10 +39,10 @@
},
"main": "lib/index.js",
"dependencies": {
"@daisy/ace-axe-runner-electron": "^1.2.4-alpha.1",
"@daisy/ace-cli": "^1.2.4-alpha.1",
"@daisy/ace-core": "^1.2.4-alpha.1",
"@daisy/ace-http": "^1.2.4-alpha.1"
"@daisy/ace-axe-runner-electron": "^1.2.4",
"@daisy/ace-cli": "^1.2.4",
"@daisy/ace-core": "^1.2.4",
"@daisy/ace-http": "^1.2.4"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/epub-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/epub-utils",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -26,7 +26,7 @@
"extract-zip": "^2.0.1",
"file-url": "^3.0.0",
"fs-extra": "^10.0.0",
"node-stream-zip": "^1.14.0",
"node-stream-zip": "^1.15.0",
"tmp": "^0.2.1",
"winston": "^3.3.3",
"xmldom": "^0.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-env-puppeteer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/jest-env-puppeteer",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-puppeteer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/jest-puppeteer",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand All @@ -23,7 +23,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@daisy/puppeteer-utils": "^1.2.4-alpha.1",
"@daisy/puppeteer-utils": "^1.2.4",
"jest-mock": "^26.6.2"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/puppeteer-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daisy/puppeteer-utils",
"version": "1.2.4-alpha.1",
"version": "1.2.4",
"engines": {
"node": ">=12.0.0",
"yarn": "^1.22.0",
Expand Down
3 changes: 3 additions & 0 deletions tests/__tests__/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ describe('Running the CLI', () => {
cwd: path.resolve(__dirname, '../data'),
});
expect(status).toBe(0);

// https://github.com/electron/electron/issues/18397
// https://www.electronjs.org/releases/stable#breaking-changes-1400
expect(stderr).toBe(false && process.env.AXE_ELECTRON_RUNNER ? `(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false". It will change to be "true" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397
` : '');
expect(() => JSON.parse(stdout)).not.toThrow(SyntaxError);
Expand Down
1 change: 1 addition & 0 deletions tests/runAceJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if (process.env.AXE_ELECTRON_RUNNER) {
// https://github.com/electron/electron/issues/18397
// require('electron').app.allowRendererProcessReuse = true;
// done in patching ./node_modules/@jest-runner/electron/build/electron_process_injected_code.js
// https://www.electronjs.org/releases/stable#breaking-changes-1400

const EventEmitter = require('events');
class ElectronMockMainRendererEmitter extends EventEmitter {}
Expand Down
Loading

0 comments on commit 5a4844a

Please sign in to comment.