Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 3649dba

Browse files
jonashaagfrozeman
authored andcommitted
Fix #1285: web3.js requires 'unsafe-eval' Content Security Policy (#1565)
1 parent 7c0b08b commit 3649dba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/web3-core-requestmanager/src/givenProvider.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ var givenProvider = null;
2626

2727
// ADD GIVEN PROVIDER
2828
/* jshint ignore:start */
29-
var global = Function('return this')();
29+
var global;
30+
try {
31+
global = Function('return this')();
32+
} catch (e) {
33+
global = window;
34+
}
3035

3136
// EthereumProvider
3237
if(typeof global.ethereumProvider !== 'undefined') {

0 commit comments

Comments
 (0)