Skip to content

Commit

Permalink
Merge pull request #3350 from Emurgo/fix/preview-network-content-policy
Browse files Browse the repository at this point in the history
fixed content policy for preview backend and analytics
  • Loading branch information
vsubhuman authored Nov 16, 2023
2 parents 7312c0e + 3da4364 commit abeff81
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/yoroi-extension/chrome/constants-mv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function genCSP(request: {|

// Analytics
connectSrc.push('https://analytics.emurgo-rnd.com/');
connectSrc.push('https://api2.amplitude.com/');

// wasm-eval is needed to compile WebAssembly in the browser
// note: wasm-eval is not standardized but empirically works in Firefox & Chrome https://github.com/w3c/webappsec-csp/pull/293
Expand Down
2 changes: 2 additions & 0 deletions packages/yoroi-extension/chrome/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export function genCSP(request: {|
frameSrc.push('https://emurgo.github.io/');
frameSrc.push('https://www.youtube.com/')

// Analytics
connectSrc.push('https://analytics.emurgo-rnd.com/');
connectSrc.push('https://api2.amplitude.com');

// unsafe-inline is unfortunately required by style-loader (even in production builds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default (isDebug: boolean, shouldInjectConnector: boolean): * => buildMan
additional: {
'connect-src': [
serverToPermission(Servers.Primary),
serverToPermission(Servers.Testnet),
],
'frame-src': [
POOLS_UI_URL_FOR_YOROI,
Expand Down
1 change: 1 addition & 0 deletions packages/yoroi-extension/chrome/manifest-mv2.mainnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default (isDebug: boolean, shouldInjectConnector: boolean): * => buildMan
additional: {
'connect-src': [
serverToPermission(Servers.Primary),
serverToPermission(Servers.Testnet),
],
'frame-src': [
POOLS_UI_URL_FOR_YOROI,
Expand Down
1 change: 1 addition & 0 deletions packages/yoroi-extension/scripts-mv2/connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Ports = {
const Servers = {
// this allows connecting to multiple different backends for different currencies
Primary: '*.yoroiwallet.com',
Testnet: '*.emurgornd.com',
};

module.exports = {
Expand Down

0 comments on commit abeff81

Please sign in to comment.