10

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?

5
  • 9
    This is not what you asked for, but Ill say it anyway. If you have never tried phpStorm, try their 30 day trial. IMHO, its a million times better than DW. Commented Aug 20, 2016 at 6:06
  • I assume you have a modern x64 OS and Dreamweaver CS6? If so, Dreamweaver is 32bit, plus Adobe has abandoned CS6 in favor for the much more lucrative CC version. The only thing I can think of at the moment is that you could <!--comment them out-->
    – zer00ne
    Commented Aug 20, 2016 at 11:30
  • I am not sure if I get your question correctly: you mean when you open an HTML file, you want it to be opened by other program like Chrome or Sublime Text? Or you want to open it with Dreamweaver but only not executing it? (if you mean the later one, I would suggest you using other editor..... phpStorm is a good choice, or Sublime, or Atom.io if you want something free. Notepad++ is also good if you are using Windows)
    – cytsunny
    Commented Aug 24, 2016 at 5:44
  • 2
    The general advice here is: don't use dreamweaver. Also, your code shouldn't contain eval().
    – tereško
    Commented Aug 27, 2016 at 12:52
  • 1
    Please don't post your code as an image.
    – Blue
    Commented Aug 29, 2016 at 9:15

2 Answers 2

5
+25

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);

3
  • Cool, could you please tell me more about the user agent(how to) because I've not heard about this previously. I'll accept the answer within 20hrs.
    – vishnu
    Commented Aug 31, 2016 at 5:58
  • 1
    The user agent is simply information about the browser/os/rendering system that's executing the current code.
    – Blue
    Commented Aug 31, 2016 at 8:30
  • In the future @vishnu, you should award the bounty BEFORE the grace period ends. At the end of the 24 hours after the bounty ends, if it's not awarded by then, it's awarded to the top answer above 2 with half the bounty's worth. RIP 25 rep.
    – Blue
    Commented Sep 1, 2016 at 11:30
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.