Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent Dreamweaver from running local code?

I'm trying to stop Dreamweaver from executing code when I open HTML files. Because the program hangs up for a long period of time when I open multiple files.

In preferences, I have set Dreamweaver to not open any related or linked files, but any local code still executes.

For example, in the image below, the lines that call eval are being executed:

1

Is there a way I can have Dreamweaver not execute this code without commenting it out?

like image 637
vishnu Avatar asked Aug 20 '16 06:08

vishnu


2 Answers

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);
like image 125
ugh StackExchange Avatar answered Oct 21 '22 20:10

ugh StackExchange


let me know if it helps Preferences -> General tab->Discover files dynamic association->Manual

like image 2
user3794314 Avatar answered Oct 21 '22 18:10

user3794314