zkparty / trusted-setup-frontend

The KZG Ceremony web browser implementation
https://ceremony.ethereum.org
229 stars 66 forks source link

Custom HTTP headers for wallet providers #80

Closed NicoSerranoP closed 1 year ago

NicoSerranoP commented 1 year ago

Portis, Torus and Formatic require specific http headers to work in our website (they use auth popups). Wasm code requires specific http headers that block popups.

Approach:

  1. check service worker in public/sw.js and see if the HTTP headers can be set for one page (doubleSign) and not for others
  2. force window reload in doubleSign page so the standard React proxy can setup the required HTTP headers
NicoSerranoP commented 1 year ago

TODOs:

NicoSerranoP commented 1 year ago

I got it working in #87 but the IPFS feature broke the whole page load flow. I tried to fix it but was not able to do it (the Hash Router makes the browser avoid calling the service worker when loading /#/something routes. The window.location.href trick does not work with Hash Router).

I decided to prevent the PR to be merged and only take a couple of changes from it into the main branch