How can we detect through PHP or maybe in node.js or other languages if a web page crashed (without the browser EXITing) so that when a user press the "reload" button on the "Aw Snap" page in chrome certain specific content inside the page can be shown in this particular case (crash case).
In a crash without EXIT, a browser shows per example in Google Chrome the famous "Aw, Snap!" page.
I don't want to know how to capture if the user refreshed the page or the page reloaded which can be known quite easily with different methods [one example see this PHP this code which can detect if users refreshed the page on major desktop/mobile browsers except IE unfortunately this code does not capture a crash event and the fact that user might request again the same page after a crash.
I tried using "register_shutdown_function", and some other maneuvers using connection PHP functions like "connection_aborted" etc... but with no success. I figure out a sloppy way through the use of session variables but probably there are better clever manoeuvres.
Any help or suggestion would be greatly appreciated. Any solution in nodejs will be also welcomed.
web brower crash because too many process from your browser to PC of Client.
this crash can't detected by php because PHP server scripting. and you have question.., why not use JS for detect crash of browser?, because JS created just for controller website,. if you force to checked that use ajax, node, etc you can't do that, why? because the problem comes suddenly
and detected crash browser from php is impossible.
I am working on an AngularJS single page web application on an Android webview. For debugging I am using Chrome Remote Debugging tools. There is a problem I am having with the responsiveness of the app at a particular place.
Using a $state.go() call, I have a routing step into a particular view, that always seems to reliably and without fail, trigger GC events.
As you can see above, the GC events are affecting responsiveness for a couple of seconds whenever this view is navigated to. There is no forced GC call in the view's controller.
I'm using a web framework where everything gets passed through a websocket. New / updated DOM elements are shipped over to the browser, events get shipped back to the server. Works great. Except when the websocket gets closed.
This happens...
when using desktop/mobile Safari's browser navigation buttons are used to leave & come back to the page
on mobile Safari after a timeout when switching to a different app, tab or screen locking
when the WiFi goes down etc.
After that the user simply sees a normal looking page, but everything is obviously dead as no more updates happen and no more events get relayed to the server. I'd like to simply refresh the page in that case. Either everything goes back to normal or the user sees a connection error in case of no network etc.
I tried poking around in the framework's code, adding "window.location.reload(true);" to the "onclose" handler for the websocket kinda does the trick. My state is 100% on the server, so reloading the page will just fix things.
Assuming I can't modify / fix the web framework I'm using, and it doesn't have any onConnectionLost client-side event, what's my best option to detect this scenario and reload the page? Are there any events like 'onPageDisplayedButNotProperlyReloaded', 'onPageVisibleButHasBecomeStaleInTheMeantime', 'onWebSocketsClosed' for me to use? Can I just open some dummy websocket and reload the page when it gets closed or something? Any other good way to detect this?
Thanks!
The problem is intermittent, but video.js is failing to load and play mp4's that have been cached in Chrome for OS X. Here's what I know so far:
Disable cache (while DevTools is open) allows the video to play 100% of the time on reload
If caching is not disabled, and cache is manually cleared the problem still happens
Closing and restarting Chrome will resolve the problem until the next page refresh
Appending a ?nocache=20131028-084318 to the source url does not resolve the problem.
Watching HTTP request using Charles Proxy, I see that on successful runs an HTTP request goes out to Brightcove (my video host). On failed refreshes, the request never happens.
On successful runs the sequence of VideoJS events:
loadstart
durationchange
loadedmetadata
loadeddata
On fails:
loadstart
I've tried a variety of ways of setting up the video element, including one noted here, Video.js Stalling during file load on iOS
and even the most basic setup noted here, https://github.com/videojs/video.js/blob/master/docs/setup.md The latter seems to work better; however, once the browser gets into a bad state clearing the cache and restarting the browser is required.
I'm having the same issue but in Chrome for Windows. I first noticed that it would only load when dev tools is open then I saw your question and realized the dev tools was bypassing caching.
If a user visits the page (on some browsers ie: Safari 6.1, etc...) the video will play the first time. If the user reloads the page by clicking in the address bar and hitting the 'ENTER' key, the video will not fire off it's LOADED/READY (or any other) events on the page 'reload'. This behavior does not happen if the user refreshes the page with the REFRESH button or REFRESH key combo (generally).
I bypassed my Brightcove player issues by dynamically loading the player on the page so it CANNOT be cached.
I also cache busted the Brightcove JS file for good measure.
Load player dynamically with this code:
http://support.brightcove.com/en/video-cloud/docs/dynamically-loading-player-using-javascript
Just some opinionated advice. Stay away form Brightcove whenever possible. My peers and I run into LOTS of bugs in their player as well as radically poor documentation.
I am not sure if this is specific to video.js. I am able to reproduce this problem by setting up a vanilla html5 video tag. It definitely looks to be related to some caching issue.
Currently, I am able to circumvent the problem by attaching a guid as a query parameter to the video url to ensure Chrome thinks this is a new video request. I do think there is a Chrome bug out there that needs to be addressed.
I Just found a ticket that matches what I can reproduce:
https://code.google.com/p/chromium/issues/detail?id=234779
I faced this problem and I solved it by disabling the cache to the javaScript file that contains the videojs instance options.
Add this line to your main page at the head
<script>document.write('<script src="vid.js?dev=' + Math.floor(Math.random() * 100) + '"\><\/script>');</script>
Note: vid.js is the file that I put the settings in..
Another solution that I didn't try, but I think it might work, is by adding the JavaScript of the settings in jQuery (ready function).
I'm running into a pretty specific problem (2 problems, actually, but I believe they're related) and am hoping someone out there can shed some light on what's going on.
I have a Meteor application running inside an HTML overlay inside of an Adobe Digital Publishing Suite (DPS) article. I've tested this with as simple of a configuration as possible, and am able to reproduce the issue consistently.
Overview
1- Meteor works fine in Mobile Safari, and Mobile Chrome on an iPad (3rd gen, ios 6.1.7) but the rendering inside of an Adobe DPS article is generating an error:
TypeError: 'undefined' is not a function
While this error doesn't affect rendering, I believe it's related to my 2nd problem:
2- Upon redirect from facebook authentication (alt. / non-JSSDK flow) the page will not render at all, but there is no additional error message other than #1 above.
Code Example / Details
1. "Headless" browser
I'm Using an HTML overlay in an article, set up inside of InDesign and published to DPS using Folio Producer. The overlay is pointing to a test url (e.g. http://dmx.dod.fbchat.meteor.com), and is refreshed each time the specific page on the article is brought into view.
The details of the browser are as follows:
appVersion: 5.0 (iPad; CPU OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B329
userAgent: Mozilla/5.0 (iPad; CPU OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B329
I do know that there are some restrictions on this browser (for example, alert = null;), and it's considered "headless" because it's not a legitimate version of chrome or safari, with no address bars, etc.
2. The redirect is achieved via the following method
create a brand new Meteor project (e.g. meteor create DPSFBRender)
decide on the meteor uri you're going to host it from (e.g. dmx.dod.fbchat.meteor.com)
create an application on facebook (https://developers.facebook.com/apps), note the App ID.
add your meteor uri to the domain and to the redirect uri on facebook. for example:
domain: dmx.dod.fbchat.meteor.com
redirect uri: http://dmx.dod.fbchat.meteor.com/
add the following two lines to the click event for the button inside your default meteor project js file:
var randID = Meteor.uuid();
window.location.href = 'https://www.facebook.com/dialog/oauth?client_id=[FB APP ID]&redirect_uri=[URL WHERE YOU'LL HOST TEST]&state='+randID+'&response_type=token&scope=[LIST OF PERMISSIONS];
So, for example, if my testing URL were dmx.dod.fbchat.meteor.com, my FB App ID were 514080555337856 and my list of permissions were lengthy (see below), my 2nd line would look like this:
var randID = Meteor.uuid();
window.location.href = 'https://www.facebook.com/dialog/oauth?client_id=514080555337856&redirect_uri=http://dmx.dod.fbchat.meteor.com/&state='+randID+'&response_type=token&scope=create_note,email,friends_about_me,friends_actions.books,friends_actions.music,friends_actions.news,friends_actions.video,friends_activities,friends_birthday,friends_education_history,friends_events,friends_games_activity,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_photo_video_tags,friends_photos,friends_questions,friends_relationship_details,friends_relationships,friends_religion_politics,friends_status,friends_subscriptions,friends_videos,friends_website,friends_work_history,photo_upload,publish_actions,publish_stream,read_friendlists,read_mailbox,share_item,status_update,user_about_me,user_friends,user_groups,user_interests,user_photos,user_relationship_details,user_status,video_upload,xmpp_login';
deploy your meteor app to the test uri (e.g. meteor deploy dms.dod.fbchat.meteor.com)
point your html overlay inside your DPS article to your URL
deploy / publish your article, open it up inside DPS viewer on the iPad, and click on the button, to activate the redirect.
You'll be prompted to allow the FB app permissions, accept.
You'll be navigated back to your meteor url, but the page will not appear.
If you change article pages, go out of the article and back in, or just bring up your app bar, and then go back to the article, the page will refresh, and render.
As long as you have your permissions set (as long as you aren't prompted to accept), the page will render fine. It is only after the FB prompts from the custom login and the subsequent redirect that the page won't render.
If you want to test it again, log into your fb account in a regular browser, and delete the app.
3. Debugging / Discovery
I started debugging this, using debuggify, and that's when I was able to see the TypeError: 'undefined' is not a function error. It doesn't stop anything from rendering at first glance, but I believe on the redirect that it is the culprit (see thoughts section below).
This error will appear on ANY meteor page that is rendered inside a DPS overlay. It doesn't have to be a redirect, or have anything on it. You can simply create a new meteor project, deploy it, point an HTML overlay in DPS to it, and the error will appear (only noticeable with a remote debugging tool like debuggify).
Likewise, this error will not occur inside of the IOS safari mobile browser, or the chrome browser. The above-mentioned rendering problem after redirect from FB will also work as expected in both browsers (the page will render after the "accept permissions" screens).
The 'undefined'... error has no stack trace:
Stack: TypeError: 'undefined' is not a function at ? (http://dmx.dod.fbchat.meteor.com/:1:0)
..although we do know that it happens after the load event:
Happened: After onload
Thoughts
I'm thinking this may be a combination of the dynamic JS loading inherent in Meteor, combined with the redirect. Simply, the redirect isn't waiting long enough for the JS to load (especially handlebars) and it therefore isn't rendering.
I don't believe the entire page is shut down, because in my app (not the tests) I am harvesting the App Key inside the URL Hash, and successfully storing it. So, I know that Javascript isn't completely shut down on the page. It's just the rendering portion for some reason that is not working.
I believe the 'undefined' is not a function error is related - could be Jquery, Handlebars, DDP.... something isn't loaded when expected. On a normal page load (e.g. a refresh) the browser is overcoming this. On the redirect from FB, it isn't.
It may have to do with the JS/Browser restrictions for the embedded DPS browser. Adobe limits some functionality (for security and for performance reasons), and maybe they're turning something off that meteor needs to run.
Workarounds I've tried:
Using the Default Meteor FB Login -- doesn't recognize the 'headless browser', and popups are disallowed in DPS anyway.
Using the standard JSSDK login flow from FB -- same deal, popups aren't allowed
Ideas?
So, at this point, I'm open to anything, even if it's not solving this specific problem.
Workarounds, similar problems you've experienced, thoughts, speculation on why this may be happening on the redirect, but not normally, etc.
I know there may be several ways to skin this cat, but I'm stuck right now, and would love to hear some suggestions. I just need to get FB login to work, inside of DPS. I don't care how, even if all the code is client side (this is just a test, not a production system)
I've even considered trying to edit the accounts-facebook and accounts-base packages in meteor to recognize a headless browser, but don't even know where to start on that...
Also, the 'undefined'... error happens on every single meteor page inside a DPS article, no matter what. That's annoying, and may be useful for some mobile headless browser compatibility improvements, if someone has any idea why it's occurring.
Follow ups are welcome as well. I'll be monitoring this thread.
It turns out that Tom Coleman helped me find this specific problem.
When JS is minified, if there's a missing semicolon, it can wreak havoc, and cause the above-mentioned 'undefined' error.
So, after further testing, I've discovered that this is most likely inside of the Adobe-specific DPS Javascript that is loaded with every overlay.
I've filed a bug with Adobe and will see if/when it's fixed, if it fixes the rendering problem as well.