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 #62 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 18d3996 + 9f12554 commit 5979d82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
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 5979d82

Please sign in to comment.