Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

fix: Use preload script as proxy for main-renderer communication#518

Merged
axelchalon merged 10 commits intomasterfrom
am-preload
May 7, 2019
Merged

fix: Use preload script as proxy for main-renderer communication#518
axelchalon merged 10 commits intomasterfrom
am-preload

Conversation

@amaury1093
Copy link
Collaborator

@amaury1093 amaury1093 commented May 6, 2019

fixes #497

Also:

All messages between main and renderer have the following format:

{
  action: string, // in capital letters, ending in _REQUEST or _RESPONSE
  from: 'fether:electron' | 'fether:react',
  payload: any // Additional payload to the message
}

@amaury1093
Copy link
Collaborator Author

I tested (in both yarn electron and yarn start):

  • closing/re-opening a node in a terminal
  • changing language

wsPort: remote.getGlobal('wsPort')
};
const RENDERER_ORIGIN =
remote.getGlobal('IS_PROD') === true ? 'file://' : 'http://localhost:3000';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone has an idea how not to hardcode these origins, I'm all ears

manifest-src 'none';
media-src 'none';
object-src 'none';
prefetch-src 'none';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefetch-src gave me a "unknown csp" warning, so I removed it

block-all-mixed-content;
child-src 'none';
connect-src https: ws:;
connect-src 'self' https: ws:;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yjkimjunior I needed to add 'self', or else yarn start didn't work

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could send a Tx on Kovan without problem. Switched language as well.

@amaury1093 amaury1093 requested a review from axelchalon May 7, 2019 09:20
Copy link
Contributor

@axelchalon axelchalon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@axelchalon axelchalon merged commit 5bdd42a into master May 7, 2019
@amaury1093 amaury1093 deleted the am-preload branch May 7, 2019 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't store language preferences both in electron-settings and localStorage Add contextIsolation=true

3 participants