How can I prevent Dreamweaver from running local code?
Asked Answered
C

2

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?

Caressa answered 20/8, 2016 at 6:3 Comment(5)
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.Bracketing
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-->Employee
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)Shaneka
The general advice here is: don't use dreamweaver. Also, your code shouldn't contain eval().Seabolt
Please don't post your code as an image.Jahdal
J
5

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);
Jahdal answered 29/8, 2016 at 9:23 Comment(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.Caressa
The user agent is simply information about the browser/os/rendering system that's executing the current code.Jahdal
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.Jahdal
M
2

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

Mescal answered 30/8, 2016 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.