From c966f90cddd36b460d2b08fe6a3c17b1b2dbf479 Mon Sep 17 00:00:00 2001 From: Erik Arvidsson Date: Tue, 22 Jul 2014 11:29:29 -0400 Subject: [PATCH] Disable eval for Firefox OS Apps Fixes #467 --- src/wrappers.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wrappers.js b/src/wrappers.js index aa6a58d..c9db60c 100644 --- a/src/wrappers.js +++ b/src/wrappers.js @@ -18,6 +18,13 @@ window.ShadowDOMPolyfill = {}; return false; } + // Firefox OS Apps do not allow eval. This feature detection is very hacky + // but even if some other platform adds support for this function this code + // will continue to work. + if (navigator.getDeviceStorage) { + return false; + } + try { var f = new Function('return true;'); return f();