Pause on any error/exception and pause on submit - debugging

I need a little orientation regarding Google Chrome debugger.
My application works only in Google Chrome because of well HTML5 support.
How can you pause on every single error/exception detected?
The source of this question it's the fact I'm doing a simple form submit with some Javascript validations.
On clicking the submit button I can see an error appearing in my Dev Tools Errors Frame, but it switch immediately to my PHP called on submit still in development, switching the page and therefore I can't read the error.
I've tried setting breakpoints and I've clicked on that pause on exceptions button, but it's not helping me, I'm doing something wrong.
I do not know completely how to use the debugger.

Have you considered trying to put a break point in a handler function for the window.onSubmit event?
Maybe something like this for jquery:
http://jsfiddle.net/7UZsk/27/
$(window).bind('submit',function(){
alert("submitting");
});​
This is the actual DOM event reference:
https://developer.mozilla.org/en/DOM/window.onsubmit

Related

Scraping an Angular website with selenium and C# returns the angular script, not the rendered web page

This seems to be by design as far as I can tell. Selenium can see the initially loaded HTML, but not the HTML after it's been massaged. I've tried IE, Chrome and PhantomJS and they all show the same behavior. So does the built-in Chrome debugger, until you inspect an element on the page, you can't query any of the rendered HTML.
I'm looking for any suggestions about how to scrape the web page. The only option I see right now is finding the chrome process, triggering the inspector, clicking inside, then running the Javascript. Needless to say, this sounds fragile.
I also haven't been able to find anything on capturing the Ajax calls from selenium so I can make them and capture the JSON. When tried copy / paste from the chrome network tab into selenium I got a missing application block message.
Does anyone have any other advice?
Since I can replicate the issue in the chrome debugger, I don't see posting code as useful. It looks like a design decision.
Ralph
Sadly, I wasn't able to do things in a straightforward way. Instead, I used Selenium to do the login and navigate to the page, then use windows API calls to click inside the window send ^a^c to copy the data and an absolute location to click on the button to go to the next page.
The site is set up so that ^a^c copies the raw data for this site. I don't know if that's standard for Angular or not.
Fragile, but it works.

WP7: Is it possible to intercept the backstack before the journal thumbnail is created/stored

You all know the Windows Phone backstack right. If you go through some apps, tap the Home key after starting each app. Now tap and hold the Backkey to see the Backstack. You can now see some small images of your apps, and can pick which one to go to right.
Question:
Is it possible to intercept before the backstack image is created? I have tried to blur my page in various events (include OnNavigatingFrom) to no avail.
My guess is some other event (probably something we don't have access to) is triggered and a bitmap is created, because when you use the Backstack to navigate you can just see a slight transition from the saved image to a real page IMO.
Does anyone know if its possible to intercept or manipulate these images on the backstack?
Example screenshot from WP emulator of the Backstack thumbnails
Following my comment, I've just tried this:
Set a breakpoint anywhere in the code
Start the app with the debugger attached, then let it reach the breakpoint
While the execution is stopped by the debugger, long press on the back button
The task switching UI is displayed even though the managed code execution is stopped
From there, I think we can safely conclude that the task switching and the thumbnail are handled entirely by native code. Therefore, there's nothing you can do.
I recently wrote a blogpost in which I discuss the ways I tried to hide data from the application snapshot. (You can read it here: http://corstianboerman.com/trying-to-hide-crucial-data-from-an-application-snapshot/)
The outcome: You just can't hide it.

strange behaviour with facebook page tab

i noticed a strange behaviour of facebook page tab applications, using internet explorer (i tested this only on ie8... with other browser this problem is not present).
If i put javascript code, or background sound in my application, when i goes out from page tab, my application is still running (for example sounds, or javascript activity)...
To show you the issue, i created a page....
Log in into facebook and goes to this page.
http://www.facebook.com/apps/application.php?id=252545344807399&sk=app_252545344807399
Don't click like button or anything... you can see a javascript alert each 5 seconds...
next, click on the top facebook logo. You will be redirected to your facebook home, but the url has an hash symbol, because it loads content in ajax.
Wait 5 seconds and tell me if you are still receiving javascript alert from my application in background.
Tell me please if you experience this problem.
Thanks in advance.
Giuseppe
(sorry for bad english)
.

javascript alert box not working in FireFox4

The JavaScript alert box is appearing without close mark on top right side nor its showing any alert symbol as shown below.
The same in IE8 works fine
Both are running on Windows 7 platform
What you're seeing is how Firefox 4 renders an alert box. They've gone for a minimalist look.
There's nothing you can do about it -- how the alert() function renders its popup is entirely at the discression of the browser, and they all do it slightly differently.
If you want control over how the box looks, you will need to write your own in Javascript, or use one of the hundreds of Javascript and JQuery examples written by other people who have already found they need more flexibility than the standard alert box can give them.
[EDIT]
Here's a blog post where the change to how the alert box works is discussed: http://www.derekallard.com/blog/post/firefox-4-alert-boxes/
There's actually a lot more that's changed than just how it looks; it actually works quite differently too in FF4.

WP7 - why does click adcontrol then back button cause page backkeypress event fired on form re-entry?

I have a number of Windows Phone 7 apps, which have a main page with a custom BackKeyPress event that on the main form throws a custom exception, in order to pass testing and get to the marketplace.
These forms have an AdControl on them. For some reason, when you click on an Ad, either in testing or production, then hit the back button, the BackKeyPress event is fired on the main form.
I have code in place to handle the issue, but does anyone know why it is giving this behavior? I can understand the event firing when the back button is pressed while on the form, but why is it fired to re-enter the form?
Is this a known bug?
I have implemented code to solve this issue, but if a bug, will my workaround code for an apparent Microsoft issue either be moot or potentially harmful in the future if the bug is fixed?
Has anyone else experienced this issue?
First thing that comes to my mind here is that the main page is not releasing properly when navigating away from it.
I haven't used the MS AdControl in a few months because it is not useful for non-US developers but when I was trying it out I remember that it would hold pages in memory if you did not unregister all the event bindings
So look at shutting it down in OnNavigatingFrom and see if that helps.
I've also encountered this problem. When debugging, it looks like the OnNavigatedFrom event is never fired, so there's no tombstoning that's happening and I don't see any place in code where I can unwire that event.
I figured it out.
You have to wire up events in the Adcontrol.AdEngaged to remove the back or AdDisengaged events to readd the back event handler.

Resources