You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
The usage of the Function constructor in this module means that mapbox-gl-js upstream cannot satisfy the Content Security Policyunsafe-eval rule. For CSP-implementing sites, a non-eval'ing method would better.
It would be possible to feature detect this and fall back to an interpreted implementation:
// Are we running under a CSP that forbids unsafe-eval?
try {
new Function('');
module.exports = require('./compiled'); // No; use fast eval'ing implementation
} catch (e) {
module.exports = require('./interpreted); // Yes; use slower interpreted implementation
}
But it would be preferable not to introduce a performance variable and use a sufficiently well performing, eval-free implementation everywhere.
Activity
jfirebaugh commentedon Aug 12, 2015
It would be possible to feature detect this and fall back to an interpreted implementation:
But it would be preferable not to introduce a performance variable and use a sufficiently well performing, eval-free implementation everywhere.
jfirebaugh commentedon Aug 12, 2015
Feature detecting probably spams CSP violation reports though, huh?
fast eval-less filter implementation
faster and simpler filter implementation
faster and simpler filter implementation