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 #61
  • Loading branch information
arv committed Jul 22, 2014
1 parent 18d3996 commit 9f12554
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 9f12554

Please sign in to comment.