Skip to content

Commit

Permalink
Revert "Revert "Upgrade Electron to v8 and minor/patch of other depen…
Browse files Browse the repository at this point in the history
…dencies""

This reverts commit 2f36a1f.
  • Loading branch information
TBubba committed Apr 29, 2020
1 parent 2f36a1f commit c68950e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 45 deletions.
67 changes: 33 additions & 34 deletions package.json
Expand Up @@ -31,72 +31,71 @@
"author": "Jesper Gustafsson",
"license": "MIT",
"dependencies": {
"chokidar": "3.2.1",
"connected-react-router": "6.5.2",
"electron-updater": "4.2.0",
"fast-xml-parser": "3.12.19",
"follow-redirects": "1.7.0",
"chokidar": "3.4.0",
"connected-react-router": "6.8.0",
"electron-updater": "4.3.1",
"fast-xml-parser": "3.16.0",
"follow-redirects": "1.11.0",
"fs-extra": "8.1.0",
"mime": "2.4.4",
"node-7z": "1.1.1",
"react": "16.8.6",
"react-dom": "16.8.6",
"react-redux": "7.1.0",
"react-router-dom": "5.0.1",
"react-virtualized": "9.21.1",
"redux": "4.0.4",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-redux": "7.2.0",
"react-router-dom": "5.1.2",
"react-virtualized": "9.21.2",
"redux": "4.0.5",
"redux-devtools-extension": "2.13.8",
"typesafe-actions": "4.4.2",
"uuid": "3.3.2",
"uuid-validate": "0.0.3",
"which": "1.3.1",
"ws": "7.2.0",
"yaml": "1.7.2"
"ws": "7.2.5",
"yaml": "1.9.2"
},
"devDependencies": {
"@types/chokidar": "2.1.3",
"@types/electron-builder": "2.8.0",
"@types/enzyme": "3.10.4",
"@types/enzyme-adapter-react-16": "1.0.5",
"@types/enzyme": "3.10.5",
"@types/enzyme-adapter-react-16": "1.0.6",
"@types/enzyme-to-json": "1.5.3",
"@types/fs-extra": "8.0.0",
"@types/fs-extra": "8.1.0",
"@types/jest": "24.0.17",
"@types/node": "12.7.0",
"@types/mime": "2.0.1",
"@types/react": "16.8.24",
"@types/react-dom": "16.8.5",
"@types/react-redux": "7.1.1",
"@types/node": "12.7.0",
"@types/react": "16.9.34",
"@types/react-dom": "16.9.7",
"@types/react-redux": "7.1.7",
"@types/react-router-dom": "4.3.4",
"@types/react-virtualized": "9.21.4",
"@types/react-virtualized": "9.21.9",
"@types/uuid": "3.4.5",
"@types/uuid-validate": "0.0.1",
"@types/which": "1.3.1",
"@types/which": "1.3.2",
"@types/ws": "6.0.3",
"@types/yaml": "1.2.0",
"@types/yaml": "1.9.7",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
"coveralls": "3.0.9",
"coveralls": "3.1.0",
"cross-env": "5.2.0",
"electron": "6.1.5",
"electron-builder": "21.2.0",
"electron": "8.2.3",
"electron-builder": "22.5.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2",
"enzyme-to-json": "3.4.3",
"eslint": "6.1.0",
"eslint-plugin-react": "7.16.0",
"enzyme-to-json": "3.4.4",
"eslint": "6.8.0",
"eslint-plugin-react": "7.19.0",
"gulp": "4.0.2",
"jest": "24.8.0",
"jest-websocket-mock": "2.0.1",
"jest-websocket-mock": "2.0.2",
"mock-socket": "9.0.3",
"ts-jest": "24.0.2",
"ts-loader": "6.0.4",
"ts-transform-paths": "2.0.0",
"ts-transform-paths": "2.0.1",
"tsconfig-paths-webpack-plugin": "3.2.0",
"tslint": "5.18.0",
"ttypescript": "1.5.10",
"typescript": "3.5.3",
"webpack": "4.39.1",
"webpack-cli": "3.3.6"
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
},
"optionalDependencies": {
"fsevents": "2.1.0"
Expand Down
16 changes: 10 additions & 6 deletions src/main/index.ts
Expand Up @@ -226,8 +226,8 @@ function onAppReady(): void {
});
// Stop non-local resources from being fetched (as long as their response has at least one header?)
// Only allow local scripts to execute (Not sure what this allows? "file://"? "localhost"?)
// (TypeScript type information is missing, check the link below for the type info)
// https://github.com/electron/electron/blob/master/docs/api/web-request.md#webrequestonheadersreceivedfilter-listener
// Method doc at https://github.com/electron/electron/blob/master/docs/api/web-request.md#webrequestonheadersreceivedfilter-listener
// CSP HTTP Header example at https://www.electronjs.org/docs/tutorial/security#csp-http-header
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
let url: URL | undefined;
try { url = new URL(details.url); }
Expand All @@ -239,13 +239,17 @@ function onAppReady(): void {
((url.hostname === 'localhost' || url.hostname === '127.0.0.1') && // Treat "localhost" and "127.0.0.1" as the same hostname
(remoteHostname === 'localhost' || remoteHostname === '127.0.0.1')))) {
callback({
...details.responseHeaders,
responseHeaders: 'script-src \'self\'',
responseHeaders: {
...details.responseHeaders,
'Content-Security-Policy': ["script-src 'self'"]
}
});
} else {
callback({
...details.responseHeaders,
responseHeaders: 'script-src \'self\'',
responseHeaders: {
...details.responseHeaders,
'Content-Security-Policy': ["script-src 'self'"]
},
cancel: true
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/CreditsTooltip.tsx
Expand Up @@ -52,9 +52,9 @@ function createOnMouseMove(current: HTMLElement): (event: MouseEvent) => void {
if (current) {
if (event.clientX <= window.innerWidth * 0.5) {
current.style.left = (event.clientX + 16)+'px';
current.style.right = null;
current.style.right = '';
} else {
current.style.left = null;
current.style.left = '';
current.style.right = (window.innerWidth - event.clientX + 16)+'px';
}
current.style.top = (event.clientY + 8)+'px';
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/GameGrid.tsx
Expand Up @@ -198,7 +198,7 @@ export class GameGrid extends React.Component<GameGridProps> {
const img: HTMLElement | null = item.querySelector('.game-grid-item__thumb__image') as any;
if (img) {
const val = img.style.backgroundImage;
img.style.backgroundImage = null;
img.style.backgroundImage = '';
img.style.backgroundImage = val;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/GameImageSplit.tsx
Expand Up @@ -127,7 +127,7 @@ export class GameImageSplit extends React.Component<GameImageSplitProps, GameIma
const item: HTMLElement | null = elements.item(i) as any;
if (item) {
const val = item.style.backgroundImage;
item.style.backgroundImage = null;
item.style.backgroundImage = '';
item.style.backgroundImage = val;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/StringFormatter.ts
Expand Up @@ -26,7 +26,7 @@ export function formatString<T extends Arg[]>(str: string, ...args: T): any[] |
const arg = args[i];
if (React.isValidElement(arg)) {
onlyStrings = false;
return React.Children.toArray(arg).map(component => ({ ...component, key: index.toString() }));
return React.Children.toArray(arg).map(component => Object.assign({ key: index.toString() }, component));
}
return arg;
} else { throw new Error(`Failed to format string. Index out of bounds (index: "${i}", string: "${str}").`); }
Expand Down

0 comments on commit c68950e

Please sign in to comment.