Disable IE9 Javascript debugger when using Visual Studio 2010 - javascript

Is there a way to disable javascript debugging when using Visual Studio with IE9?

If you click the Tools (Alt+X) button, then click the Internet Options menu item.
In the Advanced Tab, and in the Browsing category:
Check Disable script debugging (Internet Explorer)
This should disable the Javascript debugger

I tried the solution provided by Dotmister, but it didn't work on my Vista (x64), VS2010 and IE9.
However I tried the following and it worked (source: http://www.visualstudiotutor.com/2011/02/disable-stopjavascript-debugging-in-visual-studio/)
Open the application Property page and select the Web tab
Select “Start External Program” and set the path to iexplorer.exe
Enter the URL in the Command line argument option
Hit F5 to commence debugging.
My debugger was very slow when I hit a breakpoint, partly because I had the Edit and Continue enabled (you can disable it in VS under Tools -> Options -> Debuggins -> Edit and Continue) and partly because I could not disable JavaScript debugging.
Now it is significantly faster.

You can also disable all script debugging in VS via:
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f

Right click the web application and choose Properties Click Web tab
on the left and choose “Don’t open page” radio button on the left
panel Start Debugging (press F5)
Open Internet Explorer and navigate the URL. { I just pinned that instance of IE to my taskbar ;-) }

If the disable checkboxes in IE doesn't work for youm then in VS go to
Tools > Options > Debugging > Just-In-Time > Uncheck Script Option.
This worked for me.

Related

Chrome disabled javascript and doesn't allow to enable it

I am not able to enable javascript in Chrome. Under Chrome javascript setting the default option for "sites can use javascript" is grayed out. Even if I add website manually under "Allowed to use javascript" the website is not loading, screenshot below.
This happened while I was trying to find a solution for another issue and followed solution from this page (the top answer), so I went to Chrome Devtools > Sources and clicked on the pause button since then the javascript has got disabled. Paused in debugger in chrome?
Note: Javascript is working fine in other Chrome Profiles. The issue is with this particular Chrome Profile.
Try right-clicking the "Sites can use Javascript" option, and inspect element:
Then, remove the disabled or disabled="" attribute from whatever element the console brings you to.
The option should be enabled. Click it and try reloading your site again.
If this doesn't work, you can try reporting any problems for whatever chrome has (I use Mozilla Firefox and I know they have a help center).
Or try re-installing the browser, because some files may be corrupt (don't worry, if you have an account you can sign-in after the reinstallation and everything should be synced).

Debug Java Script with Visual Studio 2015 on Chrome or Firefox

I can debug with IE without any problem, but when I try different browsers code is not stopping on breakpoints. I hava a project that is currently not compatible with IE. I'm using OpenJSCAD as a dependency in my project, therefore I need to debug on Chrome or Firefox.
Is it possible to debug Java Script with Visual Studio 2015 on Chrome or Firefox?
You can absolutely do it, however it is a bit tricky to do. In the toolbar, click the button to get the dropdown of browsers to debug with and then click "Browse with...". Click "Add...", set Program to wherever Chrome is on your machine and set Arguments to --remote-debugging-port=9222. You can also set Incognito as I have to ignore cache but it is not required.
Important! Chrome cannot be started before, Chrome needs to start fresh from Visual Studio otherwise debugging won't work.
After this goto "Debug" -> "Attach to Process..." -> select the chrome instance with the title of your project or similar and then click Attach.
If everything works you can now Debug your Javascript in Visual Studio and use all Chrome features as well.
Note that when you have attached to the process you can't just stop
debugging without terminating chrome.exe. However you can get around
this by clicking "Debug" -> "Detach all".
Javascript debugging in visual studio is not possible when we use non IE browser as debugging browser. The developer tools available on non-IE browsers are the first alternative(F12) to the JavaScript debugging.. If they are still not helping, the one should look for third party tools like https://www.jetbrains.com/webstorm/features/#JS_debugging
More Info on Debugging
I had this problem... And I realized what was happening, it was in my web/javascript App. I had an ahref link target='_blank', which created a new window out of the debugging process. So when in the new window no debugging. When in original VS window debugging works. Either temp disable the target _blanks, or hand change the URL in your current window.
Remember to set the Select "WebKit Code" as the "Attach to" option.
Also, to avoid having to start a fresh chrome every time I use Chrome Canary as the target process.
One thing I find annoying with this is that breakpoints placed in the original .js source files are ignored as VS creates "dynamic" script files in which the actual debugging is performed, I wonder if these can be synced somehow?

How to make JavaScript break into IE built-in debugger (F12) rather than Visual Studio debugger?

I often use this to debug JavaScript in IE (fiddle):
if (confirm("Debug from here?"))
debugger;
If I choose "yes", I see the prompt to start Visual Studio just-in-time debugger, which I proceed with to debug the script in Visual Studio.
Now I want to use IE built-in debugger instead of Visual Studio. I use this workaround:
if (confirm("Debug from here?"))
throw "debug";
It works, but I have to check "Continue after exception" in IE built-in debugger every time I hit throw. Also, throw is different from debugger (which just continues execution if debugging is disabled in IE options).
Is there a way to make debugger keyword to break into into IE built-in debugger (F12) rather than Visual Studio debugger?
Setting breakpoints in IE F12 tools, then refreshing the page with F5 is not an option, because the page is a postback.
EDITED. Chrome browser actually gives me the desired behavior. To see what I mean, open Chrome, hit F12 to open Dev tools, then navigate to http://jsfiddle.net/jTwsh. Click [OK] upon confirm and you should get into debugger right on the debugger line.
Suggest to disable the Just-In-Time debugger for Script; if you do not want to use it for.
See the below reference on how to enable/disable JIT Debugger:
Enable/Disable Just-In-Time Debugging
I am using IE8, there i need to start the script debugging by pressing 'Start Debugging' button or F5 under 'Script' tab in Developer Tools.
See the attached screenshot:
Don't run the website in debug. It is possible to run website in 'normal' runtime:
Right-Click on any page => View in browser
or ctrl+f5

Webstorm not refreshing modified JavaScript files

My HTML page references a few JavaScript files like:
<script type="text/javascript" src="MyClass.js"></script>
I am debugging with WebStorm using a Python SimpleHTTPServer in Windows with Chrome. I can set breakpoints in my JavaScript and WebStorm stops at them as expected.
However, sometimes when I make changes to my JavaScript and relaunch the debugger, it runs the old code, not the updated code. If I place a breakpoint, the line it stops at is out-of-sync with where I've placed the breakpoint.
How can I force a refresh?
The problem was Chrome (and Firefox) caching JavaScript - maybe this is beyond WebStorm's control. It is solved as follows:
Chrome
F12 to open the developer panel, then right-click Refresh in toolbar -> "Empty cache and hard reload"
or; F12 to open the developer panel, Settings icon bottom right, check "Disable cache"
Firefox
Install Web Developer toolbar, Disable -> "Disable Entire Cache"
or; see this accepted answer

debug javascript in MVC 3 View

Can we set a breakpoint in javascript(jquery) code in a asp.net MVC 3 view?
I want to debug it because I have to.
I used F12 in IE 9 but no clue.
Visual Studio doesn't play very nicely with javascript debugging, and neither does IE.
Try using Firefox's Script tab in FireBug, you can set breakpoints there and then refresh or reload the page to hit the breakpoint. It allows step by step execution.
Or in chrome, try going to sources, then with the small icon in the top left of the tab, select the script you want to debug. Clicking on one of the line numbers will set a breakpoint for that item. You will notice that when clicking refresh after doing this there are a few options. Any will do, but a normal refresh works to hit the breakpoint.
You can use developer tools of your browser.... just press F12 (chrome, ie)
must set the break points on the js source... and play with your page.
I use chrome... Chrome developer tools tutorial

Categories