Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

contextIsolationを有効にしてcontextBridgeを使用する #13

Open
netalkGB opened this issue Jul 29, 2021 · 1 comment
Open

contextIsolationを有効にしてcontextBridgeを使用する #13

netalkGB opened this issue Jul 29, 2021 · 1 comment

Comments

@netalkGB
Copy link
Owner

netalkGB commented Jul 29, 2021

  • Electron 12以降ではcontextIsolationがデフォルトで有効になっている
  • 旧バージョンからの移行であり、contextIsolationが無効であること前提で作られているため、contextIsolationが無効にしている
  • デフォルトで有効になっている上、セキュリティ�向上のためやりたい
@netalkGB
Copy link
Owner Author

netalkGB commented Aug 22, 2021

今: preloadとrenderer間でwindowオプジェクトが共有されているため、windowオプジェクトのメンバにNode.jsの機能を呼び出すモジュールを渡すことでrendererからNode.jsの機能を呼び出している(大部分がこれで作られているため、段階的にやるのがよさそう)
次: Node.jsの機能を呼び出す場合は必ずIPC経由で呼び出す
最終: contextIsolationを有効にし、preloadでcontextBridgeを利用する

@netalkGB netalkGB changed the title contextBridgeを利用する contextIsolationを有効にしてcontextBridgeを使用する Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant