diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cfc403..e6c438d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog +## Unreleased + +- Use `globalThis` polyfill to get global object, as using `eval` was failing with strict CSP policies + ## 0.1.11 - July 9th 2017 - - On nodejs, decode strings using UTF-8 instead of ASCII. Ideally we'd do this in the browser (UTF-16 currently) as well but that is a bit more work. +- On nodejs, decode strings using UTF-8 instead of ASCII. Ideally we'd do this in the browser (UTF-16 currently) as well but that is a bit more work. ## 0.1.10 - July 9th 2017 diff --git a/browser-global.js b/browser-global.js index fbca317..f2a19b4 100644 --- a/browser-global.js +++ b/browser-global.js @@ -1,3 +1,3 @@ var api = require('./index'); -var global = (1,eval)('this'); +var global = require('globalthis/polyfill')(); global.ExifParser = api; diff --git a/index.js b/index.js index 5c7ee88..0a5cc69 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,5 @@ var Parser = require('./lib/parser'); - -function getGlobal() { - return (1,eval)('this'); -} +var getGlobal = require('globalthis/polyfill'); module.exports = { create: function(buffer, global) { diff --git a/package.json b/package.json index 11dfcd0..1da229e 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,8 @@ "devDependencies": { "browserify": "^7.0.0", "uglify-js": "^2.4.15" + }, + "dependencies": { + "globalthis": "^1.0.0" } }