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

Commit

Permalink
fixed hasEval in case of Chrome Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoa V. Dinh committed Apr 7, 2014
1 parent 4fe518f commit e049021
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ window.ShadowDOMPolyfill = {};
// even when the exception is caught
var hasEval = !('securityPolicy' in document) ||
document.securityPolicy.allowsEval;

if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
hasEval = false;
}

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

0 comments on commit e049021

Please sign in to comment.