blake-regalia / graphy.js

A collection of RDF libraries for JavaScript
https://graphy.link/
ISC License
161 stars 3 forks source link

'unsafe-eval' Error #58

Open BenjaminHofstetter opened 2 years ago

BenjaminHofstetter commented 2 years ago

In short this line leads to a 'unsafe-eval' error when this code is used in a Chrome Browser Extension.

https://github.com/blake-regalia/graphy.js/blob/5eecccae7c0cf04c0ddd84caef022484cfc563f5/src/core/iso/stream.js.jmacs#L191

With Manifest v2 it was possible to allow unsafe-eval with a Content Security Policy. But Manifest V3 doesn't allow this anymore and Manifest v2 will be removed in 2023.

Is it possible to change this line and avoid the new Function(xxx) and do something like ?

const b_is_node = (() => {try {return this===global;}catch(e){return false;}});