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

Commit

Permalink
Disable eval for Firefox OS Apps
Browse files Browse the repository at this point in the history
Fixes #467
  • Loading branch information
arv committed Jul 22, 2014
1 parent c669777 commit c966f90
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 c966f90

Please sign in to comment.