Debug Chrome on Google TV - google-chrome

Any ideas on how to get memory usage, Javascript errors, etc. from Chrome running on Google TV?
I have a page that is getting the "Aw, snap!" error when viewed in the Chrome browser on Google TV (Logitech). The page is fairly simple, but it does load a bunch of photos, though only up to 7 at a time (the photos are loaded using JavaScript). The photos are 640x480 and ~500KB each. They are stacked and the top one fades out (using jQuery) until all are gone then a new batch is loaded.
It only crashes on Google TV (it runs fine on Windows 7) and it takes a while before it crashes (I can get it down to about 10-20 minutes before it crashes by turning on a "fast mode" on our page).
Unfortunately I can't figure out how to get any information that might help me debug it. It would be cool to be able to get Chrome's developer tools on the Google TV device.

Currently there is no way to pull debug information from Chrome on Google TV. The Logitech Review is rather limited in it's RAM and you may be encountering an issue there (I don't know how big these images are). It is also possible that you have a memory leak in your javascript code. This might be hidden on other systems running a browser as there would be more memory to buffer you from seeing the error.
My advice would be to create a virtual machine (VirtualBox is free and runs on Windows) - create a VM with limited memory (256Mb Ram for instance) and install Ubuntu or some other flavor of linux that can run Chrome. Then run your app in the VM and see what happens.
Failing that you could always try loading the imaged with static image tags and see if it is the images that are causing the crash. If it's not the images then I would say look at your JS code closely and perhaps run it through JSLint (http://www.jslint.com/)

Related

How can I disable the buggy "Chrome media router" (Chromecast) extension on a Chromebox using a CLI?

We have a rack of 50 individual Chromeboxes running headless (in kiosk mode). A Chrome update came out in the past few weeks, and ever since then, all these things have been constantly going down after several hours. The screen turns white with the Aw Snap! error. In the logs we've determined that the inbuilt "Chrome Media Router" extension for Chromecast is the culprit. It keeps crashing and taking down the entire process.
We do not want Chromecast running on these devices at all, for a huge number of reasons, but Google is very aggressive about firing it up whether you want to use it or not. There are smart TVs throughout the building that also offer no way to turn it off. So Chromecast has always been a scourge for us, but with all the system crashes it's now wreaking havoc on a daily basis.
Chromecast can be disabled in Chrome using the chrome://flags page, but it requires a UI. We only have CLI access to these boxes, and there is no command line switch for turning this stupid thing off. Supposedly you can set a policy file somewhere but this is undocumented for ChromeOS.

How to test mobile chrome's "save to homescreen" prompt

I'm resurrecting an old project of mine as a way to learn some new stuff.
I'm doing this code lab from IO Add Your Web App to a User's Home Screen.
Is there any way, other than connecting a phone and waiting a lot, to test if users will be shown the prompt below?
I've tested it with Lighthouse and all tests come back green, but I've never seen the prompt. It feels very random at the moment.
The answer to This question puts the stuggle into perspective:
The user has visited your site twice over two separate days during the course of two weeks
Does that mean I need to wait 2 days between changes to see if it worked?
Enable chrome://flags/#bypass-app-banner-engagement-checks and you will see the banner as long as you have a manifest (configured correctly) and are on HTTPS and have a service worker.
Increasing Engagement with Web App Install Banners
anshulix has correctly answered the question, but I thought I'd put in a more verbose answer.
To remove the waiting and other requirements for the save to homescreen prompt, then you need to enable a flag.
Enable chrome://flags/#bypass-app-banner-engagement-checks and you will see the banner as long as you have a manifest (configured correctly) and are on HTTPS and have a service worker.
Which comes from Increasing Engagement with Web App Install Banners
It's important to remember that you are setting this flag on the mobile browser, not on your desktop browser. For some reason this didn't occur to be for a while!
You also need to restart mobile Chrome for the flag to take effect. If you've got your tabs mixed in with your other apps, this can be tricky because you need to hunt down all the tabs and close them. (Or find a better way to close Chrome.)
I found it much easier to do this debugging in Chrome Dev, rather than regular chrome because a) I know it's got the latest fixes in it, and b) because I only have 1 tab open, so it's easy to restart the browser.
If you are doing remote inspection, there is an issue about the messages that come up in the console. In Chrome 50 you get:
App banner not shown: could not determine the best icon to use
This doesn't seem to be true; in more recent builds—e.g. mobile Chrome 52—save to desktop works just fine. It's a disconcerting but useless error.
As a bonus helpful thing, realfavicongenerator does an excellent job of generating all the icons and the manifest file that you need.

debug request timing using Chrome

Good Morning - Can someone point me to a good resource that would help me understand what's going on in a Chrome debug sources graph?
I want to understand what is going on during that big space of time between kendo.all.min.js and cake.generic.css.
Neither the apache logs nor the php logs give any hints.
I'm not looking for an answer necessarily, just what tools to troubleshoot the latency.
CakePHP 2.6.2, Kendo UI PHP (trial), Xamp 3.2.1
Browser load resource files (Javascript, CSS, images, etc.), for latency inspecting, you press F12, choose Network, press and hold to see Latency timeline.
(open screenshot image in a new windows for big size)

Memory Issue in WP8 emulator?

My app is like a tweet feed reader. But with use, the app's responsiveness slows down in the wp8 emulator. By being unresponsive, I mean the progress bar indicator speed slows down, no links respond, none of the app buttons respond and the app suddenly closes.
I think it is a memory issue with the emulator. Am I right? I can't test it as I don't have a device yet.
Even on increasing the memory using the Hyper-V settings I didn't observe much difference.
I have an in-app browser which works fine for the first 2-3 links but then makes the app hang!
This doesn't sound like a memory leak. What you're describing is a slow-down which is caused by putting too much work on the UI thread. Overall you should offload as much work as possible to a background thread or the compositor thread.
The app suddenly closes sounds like some unhandled exception, but it's hard to tell which one. You said the app works fine on WP7. Have you looked at known app compatability issues that occur once WP7 apps are upgraded to WP8? Check it out on MSDN # http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206947(v=vs.105).aspx
This really isn't enough to go on. Is there something printed out in the output window once the app crashes? Can you tell what's the last managed method to be invoked before the app crashes? Can you try profiling the app for CPU and see what's the method that's most invoked? And profile for memory usage and see how's memory consumption right before the crash?

Getting memory issues in Blackberry

I am developing a phonegap app using HTML, CSS, jquery in Blackberry and in this app, sometimes when I relaunch the app, I am getting memory alert and app gets quit. I have placed all images that I am using in a folder. How can I handle the memory issues?
Even I am facing a similar issue of device memory low in my HTML5+Phonegap BB app.
I face this problem often in BB 6.0 device but in BB 7.0(9900) I haven't ran into this problem yet.
On page 24 of the link posted by tennesha the BB memory architecture is briefly explained by tneil . I quote
"The amount of physically allocated memory varies between device models, but lets say on average it's approximately 40MB of RAM. This amount of memory is allocated for both running WebKit (loading the engine into memory, running JavaScript, displaying pages, computing layout, scaling images, etc.) and also loading your content in the view.
All apps on the device share the same WebKit instance so everyone shares the same 40MB space. Think of each app using a web view as creating a "virtual tab" in the same web kit instance."
Here's the link for your reference.hope this helps.
http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-an-WebWork-app/td-p/1166441/page/24
Hope they solve this issue at the earliest.
Blackberry has a memory leak issue that is not resolved as yet. I use to develop apps for blackbery using html 5 but pretty much gave up. The platform has too many issues and is not ready for html5 app develpment. You can follow this link and see if there is any thing useful you can garner from it: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-an-WebWork-app/td-p/1166441 . Oh and by the way dont expect to get much real help from blackberry with this.