I am building an ASP.NET Web Forms application (not site) and whenever I debug with Internet Explorer, I cannot seem to disable the integrated Javascript debugging with Visual Studio 2013 Pro.
How do I get it to stop breaking on Javascript exceptions?
My OS is Windows 2012 Server R2 (so, equivalent to Windows 8.1 Pro) with IE11. I have tried every setting that I could find but nothing has worked so far. I have even logged out and back in. I am going to try a complete reboot right now.
The screenshots below show all the settings I've tried.
Exception and Settings:
Visual Studio Options - Debugging:
Internet Explorer Options:
BrowserLink Disabled
If you run your web project with IE, VS will automatically attach to the IE process and debug it and there is no way to disable that.
So, start debugging with Chrome or Firefox if you don't want VS to debug IE automatically when you run your project. Then open up IE and navigate to your site if you still need to test with IE.
There is no user-unhandled column on yours Exceptions window, if its hide make it appear and uncheck all check marks. See:
Related
I have successfully installed Windows 10 Insider Preview and Visual Studio 2015 RC on my PC, and Windows IOT Core on my Pi.
I have created a new JavaScript Windows Universal App solution in Visual Studio, and tried to deploy as-is, i.e. the project as supplied in the template. When trying to run the program on the remote machine, in either debug or release modes, the project deploys and runs successfully, however Visual Studio advises with a modal dialog box during the deployment process:
"Failed to create the web diagnostics object. The JavaScript Console and DOM Explorer may not work. Repairing the remote debugger installation may help".
Firstly, can I expect these tools to work on the Pi for a JavaScript Windows Universal App?
Secondly, I don't know how to repair or even access the remote debugger software. It seems to run automatically (msvsmon.exe, twice). Is here something to configure properly to get it to run?
Regards,
Paul
It indicates that you don't have admin access to remote machine, which is natural assuming that you didn't have activated developer mode in BOTH machines.
otherwise, I could say that this could be a bug(but only if you can see the DOM in explorer) you can't disable DOM explorer in V.S either so if this didn't fix the issue and it's annoying, then you will have to wait for update 1 unfortunately.
The only workaround I found was to install Windows 10 on my Dev computer. It appears like this does indeed not work with Windows 8.
I am currently working on a HTML/JS application that will be embedded in an iOS and an Android app. Because the android app is not yet finished I am testing this on the chrome browser in Android. I fixed all issues there but when I open the same web app in the native browser nothing really works as expected.
So my question is : Is there a way to debug in a native browser on an android device?
In chrome this was pretty easy with remote debugging.
(Please do not advice me to use 'log' statements for debugging because that's not what I am looking for here)
And just to spill my guts : the Samsung Tablet's native browser is the only device that's causing me a headache!
Typing about:debug in the address bar of the native browser will toggle the 'Debug' options in the settings menu.
The 'Show JavaScript Console' option will allow you to see JavaScript errors in your webpage.
NB I believe the JavaScript Console will only be displayed if there is an error.
HTH
Nick.
The new Samsung Internet browser (I think you meant this browser with "Samsung Tablet's native browser") is now based on the Chromium browser and thus supports its remote debugging interface.
Enable USB debugging on your device as described here.
Then connect your device via USB (Oh, surprise!).
Visit chrome://inspect on your computers Google Chrome browser and you will be guided to create the connection:
Then you just have to click on the devices inspect link and an developer tools window will pop up.
More info like why there is an Samsung Internet Browser at all can be found here.
You can easily debug your web application with Web Inspector Remote (weinre).
Look at this post in order to find out how to install and use weinre.
I hope it will help you if this question is still actual.
If you have updated your device you can go to settings -> Debug -> 'Remote Debug Enable'
Once enabled you can debug the native browser just like you can debug chrome.
You can try vorlon solution too, it has a nice web interface & very easy to install
& It's free
But if you can't see clear console errors with volron, you probably want to use #Nick's solution, sometimes complex errors prevents even vorlon or weiner from catching them. So once you fix blocking these issues, probably volron will start catching them properly
I'm developing a webapplication (asp.net mvc 4) with Microsoft Visual Studio 2012, and as the solution is getting bigger, the debug is getting slower.
Need to know if there is a way to debug only my client side (javascript) on visual studio instead of the entire application (server+client).
Is there any way to attach to process of IE and get the breakpoints working ....?
Not interested on get the debugger running on entire client/server application, just client.
First open Visual studio ..select your project in solution explorer..Right click and choose option "browse with" then set IE as default browser.
Now open IE ..go to
Tools >> Internet option >> Advance>> uncheck the checkbox having "Disable Script Debugging (Internet Explorer). and then click Apply and OK and you are done ..
Now you can set breakpoints in your JS file and then hit the debug button in VS..
EDIT:- For asp.net web application right click on the page which is your startup page(say default.aspx) and perform the same steps. :)
Yes you can put the break-point on client side page in Visual studio
First Put the debugger in java-script code and run the page in browser
debugger
After that open your page in browser and view the inspect element you see the following view
The debugger should automatically attach to the browser with Visual Studio 2012. You can use the debugger keyword to halt at a certain point in the application or use the breakpoints directly inside VS.
You can also detatch the default debugger in Visual Studio and use the Developer Tools which come pre loaded with Internet Explorer or FireBug etc.
To do this goto Visual Studio -> Debug -> Detatch All and then click Start debugging in Internet Explorer. You can then set breakpoints at this level.
For debugging JavaScript code in VS2015, there is no need for
Enabling script debugging in IE Options -> Advanced tab
Writing debugger statement in JavaScript code
Attaching IE didn't work, but here is a workaround.
Select IE
and press F5. This will attach both worker process and IE as shown here-
If you are not interested in debugging server code, detach it from Processes window.
You will still face the slowness when you press F5 and all your server code compiles and loads up in VS. Note that you can detach and attach again the IE instance launched from VS. JavaScript breakpoints are hit the same way they are in server side code.
It is possible to debug by writing key word "debugger" to place where you want to debug and just press F5 key to debug JavaScript code.
http://www.aspsnippets.com/Articles/Debug-JavaScript-and-jQuery-using-Visual-Studio-in-Internet-Explorer-browser.aspx
This is what worked for me:
Add a new browser with to ie x86 version
2- On the Start Options of the Property Pages select the Start Option as:
Don't open a page. Wait for a request from an external application
3- Open the application from internet explorer
4- In the attach to Process screen select the following code types:
Javascript (Microsoft edge - chromium) and Script
5 - In the available process list select:
iexplorer.exe x86
I need to debug some JS that isn't working in IE7, so I installed Visual Web Developer 2010 Express into my IE7 virtual machine, with the intention of using it to debug whatever I want. But when I get a Javascript error in IE7, I only get the generic "problems with this website" message, and no debugger:
"Disable script debugging" is off in Internet Options and "Display a notification about every script error" is on. I have tried resetting the default settings for both IE and Visual Web Developer, and disabling all add-ons for IE.
Anybody know what gives?
Make sure your default browser is set to the browser you're trying to test against (in this case, IE 7). When you start debugging your empty project in Visual Wed Developer, it should open the default browser.
Not sure about the nature of it, but some magic happens behind the scenes that enables the script engine in IE to be exposed to the developer through the IDE.
I want to debug my PhoneGap app in Xcode, but its Console can not show javascript errors.
The most elegant way to view and debug JavaScript errors in your Cordova/PhoneGap App is by attaching the Web Inspector from your Safari browser to the Web View in your iOS App (but, like Tom Clarkson already mentioned, you will need at least iOS 6).
On your iPad or iPhone use the Settings App to enable Web Inspector in the Advanced Settings for Safari
Connect your device to a Mac via USB (it will then appear under the Develop menu of Safari)
Start your App
Navigate to the Web View you want to debug
On the Mac, from the Safari Develop menu, select the name of your device and the App (its HTML-page), from its sub menu
A Web Inspector window will open, enabling you to browse the DOM, set breakpoints etc.
Apples documentation on setting this up
A thorough third party tutorial
Alternatively you could connect Chrome’s Web Inspector to iOS devices after installing iOS WebKit Debug Proxy. This also opens up the ability to do the inspection from Linux or Windows.
Remote access to your iOS’s HTML, CSS and JavaScript has gotten even more flexible nowadays because you can install the RemoteDebug iOS WebKit Adapter on top of aforementioned Debug Proxy. Because this adapter translates the WebKit Remote Debugging Protocol to the Chrome Debugging Protocol, these (on all their supported platforms) become available as alternative debugging and inspection tools:
Visual Studio Code
Chrome DevTools
Mozilla Debugger
BTW, remote debugging with the Safari Web Inspector works even in combination with the iOS Simulator.
Minimum version of Desktop Safari per iOS version
For each version of iOS you will need a specific minimum version of Desktop Safari in order to use remote web inspection, see the list below.
iOS 6
Safari 6+
iOS 7
Safari 6.1+
iOS 8
Safari 7.1+
iOS 9
Safari 8+
iOS 10
Safari 9+/10+? Please comment; always try Safari Technology Preview
iOS 11
Safari 11+
iOS 12
Safari 12+
Paste the following somewhere near the start of your document so that it gets executed before any of your other JavaScript.
<script type="text/javascript">
window.onerror = function(message, url, lineNumber) {
console.log("Error: "+message+" in "+url+" at line "+lineNumber);
}
</script>
And enjoy viewing details of your Javascript errors in the Xcode console window.
UPDATE: The above technique will log errors such as undefined variables. But syntax errors such as missing commas will still cause the entire script to break without logging anything.
Therefore you should add the following to the start of your onDeviceReady function:
console.log('Javascript OK');
If you don't see "JavaScript OK" appearing in your log window when the app launches, then it means you have a syntax error somewhere.
To save hunting for missing commas, the easiest thing is to paste your code into a Javascript validator such as this one:
http://www.javascriptlint.com/online_lint.php
and let it find the error for you.
Hopefully that takes some of the pain out of debugging.
Note that with 0.9.2 (released today), console.log has been standardized across the platforms for logging (with debug.log deprecated).
There is a function that is available on the desktop WebView that is not exposed in the iOS UIWebView that will catch all errors (I'm trying to hack that functionality into a plugin, which uses private APIs, but the plugin would only be for development), but for now do what Kris suggested above and put try catch blocks on code and use console.log
To quickly catch possible syntax errors, when developing I have the page loaded in desktop Safari and quickly refresh it with the webkit error console viewable.
debug.log will send messages to the XCode console in Phonegap (allowing you to either log the result of an exception or do some debugging), however, you are correct that you have to debug other javascript errors in Safari (either on the desktop or on the iphone with Debug Console turned on). I have yet to find a Javascript error, that was caused by running on the iphone and wasn't present when debugging with the console turned on in Safari (though I know there are a few differences between the WebView and Safari on the iphone).
I just came across Weinre
It's a remote javascript debugger for phonegap. You can either setup your own Weinre server, or use the one at http://debug.phonegap.com/
It seems to work well - very impressed so far.
If you use iOS 6, you can simply attach the safari web inspector (on the develop menu of desktop safari) to your app and get full javascript debugging.
There are a couple of areas where it is a bit limited - startup errors and plugin calls - but it works well for pretty much anything else.
For making javascript debugging work in Xcode I would take a look at the following.
http://phonegap.com/2011/05/18/debugging-phonegap-javascript/
http://www.daveoncode.com/2010/01/12/debugging-phonegap-applications-using-xcode-console/
As as far as additional troubleshooting goes...
To start with you could run the app in safari on you pc and utilize safari's debugger (or chrome as both are running similar rendering engines). This won't hit on the advanced logic errors and many of your api issues but it at the very least should help with troubleshooting many issues (basic javascript, HTML5 etc....).
To view all errors in javascript console, I agree to use this event listener
<script type="text/javascript">
window.onerror = function(err,fn,ln) {alert("ERROR:" + err + ", " + fn + ":" + ln );};
var errorVar = objectDoesntExists.properyDoesntExist;//this will simulate an error
</script>
However, unless you have the cordova plugin installed, it wont show on XCodes "console". Go to your project folder and type this:
? cordova plugin add cordova-plugin-console
This will allow the javascript command 'console.log('some string') to show on XCode.
Note you will need git, etc... but if you are editing your phonegap project in xcode, you will most probably have it!
PS Make sure you put the cordova.js script plug-in before any use of console.log
<script type="text/javascript" src="/cordova.js"></script>
Put this in the beginning of your index.html
<script type="text/javascript">
window.onerror = function(err,fn,ln) {alert("ERROR:" + err + ", " + fn + ":" + ln);};
var errorVar = objectDoesntExists.properyDoesntExist;//this will simulate an error
</script>
Here's a simple way that worked for me:
cd to the directory containing your index.html file in the terminal
Start a http server using python by invoking (I used python 2.7):
python -m SimpleHTTPServer
View the page in safari by entering the address of the HTTPServer in a browser, for me the URL was:
http://0.0.0.0:8000/
Open developer tools:
In chrome this is alt+command+i. View the console tab, may need to refresh the page.
In Safari: Safari --> Preferences --> Advanced --> check "Show Develop Menu". Develop menu --> Show error console (or alt+command+c). Refresh the page. Hitting CTRL+5 opens the issues tab.