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 #48 from dinhviethoa/chrome-apps-csp
Browse files Browse the repository at this point in the history
Fix detectEval() when running in Chrome App environment
  • Loading branch information
arv committed Apr 7, 2014
2 parents fca8a33 + 3103f66 commit cb07976
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
return false;
}

// Don't test for eval if we're running in a Chrome App environment.
// We check for APIs set that only exist in a Chrome App context.
if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
return false;
}

try {
var f = new Function('', 'return true;');
return f();
Expand Down

0 comments on commit cb07976

Please sign in to comment.