02-01-2013 10:06 AM - edited 02-01-2013 10:07 AM
Hi, I need to maintain a web application that causes a browser deadlock. When the freeze occurs I have to wait 5 minutes for the browser to crash or remove the battery.
I tracked down the problem and the cause is simply a javascript alert that is called when the page loads. If the user drags the page at the same time, it freeze.
Obviously, it doesn't happen 100% of the time since I believe it is a deadlock. One has to load the page several time and drag it to see the issue.
I can reproduce the issue with a page containing the following code only.
( I also tried doing the alert in the window.load event but with no success)
<html>
<head>
</head>
<body>
<script type="text/javascript">
<!--
alert("ERROR - The notification no longer exists.");// -->
</script>
</body>
</html>
I manage to fix this by wrapping the alert in a timeout function. however, I do not like this solution at all nor do I know if it is 100% safe. Anyone know a more solid fix to this?
I was thinking of removing the alert and simulating it with a div but would prefer to do as little modification as possible to the code.
Thanks.
02-01-2013 06:16 PM
hey erich412,
you can try putting your alert into the body's onload listener function like this:
<script>
window.onload = function () { alert("ERROR - The notification no longer exists."); }
</script>
This will cause the alert to show up after the page is done loading (which maybe attribute to why your browser may be failing). Good luck!
02-01-2013 08:07 PM
Thanks for the tip,
Unfortunately I already tried using the "load" event and it still freeze if I drag the window while the page is loading and the alert window shows up.
02-04-2013 09:25 AM
I managed to make the browser freeze with the timeout function wrapping the alert.
The problems occurs only when I drag the screen when the alert shows up. Because of this result, the browser hang has nothing to do with the fact that the page is loading. (This explains the reason why the onLoad event did not work)
I made another demo. A button on screen that calls the alert function when I click on it. This case do not freeze since the onclick event seems to cancel itself when I drag the screen after clicking the button. So I cannot reproduce the behavior.
Also, I tried other blackberrys with the same OS and the freeze also occurs. So it's not only my device that is bugged.
02-06-2013 07:57 AM
I assume you are compiling this 'app' with Ripple? If so, what version of the SDK are you using?
02-06-2013 12:17 PM - edited 02-06-2013 12:24 PM
Hi,
I do not use Ripple. The app is a simple web page made with asp.net. and visual studio that runs on a web server. Nothing is run on the blackberry itself beside the browser.
The html code I posted above can also reproduce the problem when I copy it in a .html page on the same web server. I can access the page with no problem using IE, firefox chrome etc. but when using the blackberry browser it can freeze.
02-06-2013 12:44 PM
Hey Erich412,
Do you have a link to the page that is causing the issues? I wanna try it out here. Thanks!
02-06-2013 01:02 PM
Unfortunately, the html page is on an Intranet.
You could download a web server on your pc and create a html page containing only the above code,
then access the page using your blackberry browser.
It freezes about 10% of time while loading the page if you drag the browser window during the process.
02-06-2013 01:07 PM - edited 02-06-2013 01:13 PM
I managed the reproduce the issue with this page :
http://www.w3schools.com/jsref/tryit.asp?filename=
It took me about 9 tries to make it freeze. The alert window was displayed but I could not click on the "ok" button.
You will need to drag the window constantly to make it freeze ( you will see the browser background with squares in it).
This page is quite long to load. I found out that the quicker it is to load the page, the easier it is to reproduce the problem.
02-06-2013 01:35 PM
Do you have latest version of 7.1 installed on this device?