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

Commit cb07976

Browse files
committed
Merge pull request #48 from dinhviethoa/chrome-apps-csp
Fix detectEval() when running in Chrome App environment
2 parents fca8a33 + 3103f66 commit cb07976

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/observe.js

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@
6868
return false;
6969
}
7070

71+
// Don't test for eval if we're running in a Chrome App environment.
72+
// We check for APIs set that only exist in a Chrome App context.
73+
if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
74+
return false;
75+
}
76+
7177
try {
7278
var f = new Function('', 'return true;');
7379
return f();

0 commit comments

Comments
 (0)