Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #473 from arv/firefox-os-apps-disable-eval
Browse files Browse the repository at this point in the history
Disable eval for Firefox OS Apps
  • Loading branch information
arv committed Jul 22, 2014
2 parents c669777 + c966f90 commit a16b028
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a16b028

Please sign in to comment.