One way is to check the useragent for Dreamweaver, and prevent code execution if it matches. Matching against 'Dreamweaver/' in the user agent should work:
if ( navigator.userAgent.indexOf('Dreamweaver/') === -1 )
{
//Your eval code blocks here.
}
Chris from Dreamweaver Engineering, posted in this thread the user agents of dreamweaver:
Mac:
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/530.19.2 (KHTML, like Gecko) Dreamweaver/11.0.m.bbbb Version/4.0.2 Safari/530.19.2"
Windows:
"Mozilla/5.0 (Windows; U; en) AppleWebKit/530.19.2 (KHTML, like Gecko) Dreamweaver/11.0.m.bbbb Version/4.0.2 Safari/530.19.2"
Here's a simple code snippet showing its usage:
var isNotDreamweaver = navigator.userAgent.indexOf('Dreamweaver/') === -1;
console.log(isNotDreamweaver ? 'You\'re not running dreamweaver.' : 'You\'re running dreamweaver.');
console.log('Current User Agent: ', navigator.userAgent);
<!--comment them out-->
– Employeeeval()
. – Seabolt