GWT1.5.3 application not loading in chrome - javascript

We have a huge GWT application which was working perfectly good in IE and chrome, but from few days it stopped working in chrome. In the developer console of chrome it says "Top identifier duplicated in *.cache.html"
I tried compiling the code only for chrome i.e putting the user agent as safari, even after this the issue still remains same.
This time i compiled the code with style as Pretty and it works good in chrome but the problem with this is *.cache.html bulks up to 9mb from 2mb, which leads to performance issues.
If the GWT compile style is OBF, the compiler is not able to generate proper scripts for chrome.
some one help me in coming out of this problem.

Related

My Javascript seems to fail on Mobile Chrome, and I'm unable to debug it on my Mac

I just published an app at http://ineedaprompt.com. It relies on front-end Javascript.
It seems to work on all browsers except the somewhat-outdated version of Chrome (v. 42.0.2311.111) I have on my somewhat-outdated Android smartphone. I've never gotten USB debugging to work with my Mac, and so don't seem to have a way of debugging the Javascript for this particular browser.
This may very well be an edge case, but I'm unsure -- I think the odds are if it fails for one browser, it will fail for others.
Are there any recommendations on how I could debug this? Or might some kind-hearted person be able to check their console tell me the reason this JS is failing?
The source code is available at the links below. Since I cannot access the console, I have no idea which lines are causing the error, and so cannot include any code in this question.
https://github.com/RobertAKARobin/inap-node/blob/master/public/ineedaprompt.js
https://github.com/RobertAKARobin/inap-node/blob/master/public/index.html

One page PDF crashes Chrome with PDF JS [duplicate]

My problem may seem a bit vague (it is to me too), but here is my attempted explanation of it.
A few months ago, I implemented PDF.js in my web application. It was really useful, and I am using it for interactions with my clients.
Suddenly, last week, my clients reported to me "Aw, Snap" messages in Google Chrome on their PCs when they try to launch PDF.js. I have an iMac and two PCs at home, so I decided to test this out.
When I used Google Chrome on my iMac to launch PDF.js, I found it worked fine.
When I used Google Chrome on my first PC to launch PDF.js, I found it worked fine.
When I used Google Chrome on my second PC to launch PDF.js, even though it previously worked, it kept crashing and showing me "Aw, Snap" messages.
This was weird. I tried removing all the extensions, clearing the cache, clearing the LocalStorage, but nothing seemed to fix the problem.
I then realised, after some communication with my clients, launching PDF.js in Safari, Torch, Opera or Firefox on any operating system worked perfectly fine.
Why would this happen? I am using the web viewer in PDF.js. I also tried with the basic hello world example, but that broke as well (which I now find really weird), so I suspect there's something wrong with the rendering engine.
I also tried including the compatibility.js file after building the source, but with no avail.
Is there any known bug which causes Google Chrome tabs to crash?
Yes, I got it now.
From https://github.com/mozilla/pdf.js/issues/4104, I found the answer (thanks Rob and PDF.js dev team!). Take a look yourself!
I'm only posting this here so that anyone who stumbles upon this post with a similar problem can be helped (as this error took me quite a while to figure out).
Unfortunately, this does not seem to be the case. We've tried the latest version of pdf.js from github, also tried Chrome 33 (stable) which should have their V8 fix included and it still crashes. Also, tried the pdf.js commit mentioned in github thread (4ce6cb8 - https://github.com/mozilla/pdf.js/commit/4ce6cb8b0fa9db948516b2b738fa1503cf0ef90e) - still crashes. Also tried latest Chrome Canary available on 19/03/2014 - crash is there.
We can provide the WinDbg memory dump if it's of any help.
PS: sorry, this should be the answer to Rob W thread right above but I cannot add it there due to 0 reputation.

How to fix Javascript code to be case sensitive in visual studio 2012

Recently I started modifying our website to be cross platform compatible. Our site was coded to work in IE 6 initially and upgraded to work IE7 then all code changes has stopped. The site was used in compatibility view until now. We are now changing the site to work for chrome, firefox, safari, and IE7(we have clients still using IE7 sadly) and above.
Quickly we noticed the javascript coding wasn't coded to be case sensitive, this wasn't a problem with IE7 but now causes most pages to crash on chrome and others.
I am going page by page finding id's and doing updates to all codes to match same casing. But this is taking a lot of time and lots of checking on each page.
I did a little search for a simpler way to fix these but could not find any solution. Is there a way to do this to all the files 100+ pages 1000's of lines of code.
We are using studio 2012 pro. We are open for any other tool that can solve the issue.
Thank you for the help.

Firefox & Ruby On Rails - hbs and js errors only in Firefox and only after deploy

The problem:
I have a RoR project working fine in different browsers, Chrome, IE, Safari, Opera, and in the three standard enviroments, local, staging and production.
I'm facing errors only in Firefox, and only after deploy to staging or production. So, it's working fine even in Firefox local enviroment. Basically the visible error is malfunction of some critical web javascript related features.
Firefox console in staging or production returns first, html syntax errors in application-xxxxxxxxx.hbs (bad formed) and second, javascript errors in application-yyyyyyyyyyy.js (this._input is undefined)
It seems that js errors comes from the errors in the hbs file, so I've tried to solve html sintax errors directly to the compiled file application-xxxxxx.hbs in staging, but when fix one error, shows another one:
auto-generated comments
nested pairs of double quotes
input, img and other html start tags without the correspondent end tags (it seems the short way o open/close a tag suddenly don't work ?!!?!?!....)
etc.
All this error stuff has no sense to me since it works fine in all browsers, even in Firefox local... so...
What strange thing makes Firefox to be so special after deploy, when any other browsers works fine in any enviroment, and even Firefox works fine in local enviroment?
By the way, I suspect, that the problem could start with a Firefox browser update...but...really don't know.
¿Any ideas?
Thank you very much for the help

Debugging JavaScript in IE7

I need to debug JavaScript in Internet Explorer 7.
Unfortunately, its default debugger doesn't provide me with much information. It tells me the page that the error showed up on (not the specific script) and gives me a line number. I don't know if that is related to my problem.
It'd be nice if it could narrow down the error to a line number on a specific script (like Firebug can).
Is there an addon to debug JavaScript in IE7 like Firebug does in Firefox?
Thank you!
See also:
Does IE7 have a “developer mode” or plugin like Firefox/Chrome/Safari?
Web Development Helper is very good.
The IE Dev Toolbar is often helpful, but unfortunately doesn't do script debugging
The hard truth is: the only good debugger for IE is Visual Studio.
If you don't have money for the real deal, download free Visual Web Developer 2008 Express EditionVisual Web Developer 2010 Express Edition. While the former allows you to attach debugger to already running IE, the latter doesn't (at least previous versions I used didn't allow that). If this is still the case, the trick is to create a simple project with one empty web page, "run" it (it starts the browser), now navigate to whatever page you want to debug, and start debugging.
Microsoft gives away full Visual Studio on different events, usually with license restrictions, but they allow tinkering at home. Check their schedule and the list of freebies.
Another hint: try to debug your web application with other browsers first. I had a great success with Opera. Somehow Opera's emulation of IE and its bugs was pretty close, but the debugger is much better.
you might want to try
microsoft script debugger
it's pretty old but it's quite useful in the sense if you stumble on any javascript error, the debugger will popup to show you which line is messing up. it could get irrating sometimes when you do normal surfing, but you can turn if off.
here's a good startup on how to use this tool too.
HOW-TO: Debug JavaScript in Internet Explorer
I've found DebugBar.
Not as good as Firebug, but close.
In IE7, you can bring up firebug lite for the current page by pasting the following in the address bar:
javascript:var firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init();}else{setTimeout(arguments.callee);}})();void(firebug);
See http://getfirebug.com/lite.html.
Microsoft Script Editor is indeed an option, and of the ones I've tried one of the more stable ones -- the debugger in IE8 is great but for some reason whenever I start the Developer Tools it takes IE8 a while, sometimes up to a minute, to inspect my page's DOM tree. And afterwards it seems to want to do it on every page refresh which is a torture.
You can inspect contents of variables in Microsoft Script editor: if you poke around under Debug > Window you can turn on local variable inspection, watching etc.
The other option, Visual Web Dev, while bulky, works reasonably well. To set it up, do this (stolen from here):
Debugging should be turned on in IE. Go into Tools > Internet Options > Advanced and check that Disable Script Debugging (Internet Explorer) is unchecked and Display a notification about every script error is checked
Create a new empty web project inside of VWD
Right-click on the site in the Solutions Explorer on the top right, go to Browse With and make sure your default browser is set to IE (it's reasonable to assume if you're a web developer IE is not your default browser in which case that won't be the default.. by default)
Hit F5, IE will open up. Browse to the page you want to debug.
VWD will now open up any time you have a script error or if you set a breakpoint in one of the JS files. Debug away!
UPDATE: By the way, if you experience the same slowdowns as me with IE8's otherwise decent debugger, there is a workaround -- if you encounter or make IE encounter an error so that it pops up the "Do you want to debug" dialogue and hit Yes, the debugger will come up pretty much instantly. It seems like if you go "straight" into debugging mode the Dev Tools never inspect the DOM. It's only when you hit F12 that it does.
IE8 has much improved developer tools. Until then it's best to write javascript for firefox first and then debug IE using alert() statements.
Microsoft Script Editor can be used to debug Javascript in IE. It's less buggy than Microsoft Script Debugger but has the same basic functionality, which unfortunately is pretty much limited to stepping through execution. I can't seem to inspect variables or any handy stuff like that. Also, it only shipped with Office XP/2003 for some bizarre reason. More info here if you're game.
I downloaded the Visual Web Developer 2008 Express Edition mentioned by Eugene Lazutkin but haven't had a chance to try it yet. I'd recommend trying that before Script Editor/Debugger.
It's not a full debugger, but my DP_DEBUG extensions provides some (I think) usful functionality and they work in IE, Firefox and Opera (9+).
You can "dump" visual representations of complex JavaScript objects (even system objects), do simplified logging and timing. The component provides simple methods to enable or disable it so that you can leave the debugger in place for production work if you like.
DP_Debug
The IE9 developer tools worked for me. Just set the "Browser Mode" menu item to IE7.
Hey I came across the same problem and found this the application IETESTER. It's pretty awesome, it's an app that has IE 5.5,6, and 7 bundled into it. It doesn't matter what IE version you currently have. This allows you to have multiple versions side by side.
If you enable javascript debugging in IE options and have Visual Studio installed you can even debug the javascript in VS with all the debug options available to you(watches, conditional breakpoints ,etc.)
If you want to start debugging before an error occurs you simply have to put the line
debugger;
into your JS code and this bring you into VS to begin debugging after this statement.
This is absolutely amazing to me for testing backward compatibility for JS code.
Use Internet Explorer 8. Then Try the developer tool.. You can debug based on IE 7 also in compatibility mode
FireBug Lite:
http://getfirebug.com/firebuglite
The answer is simple.
Get Internet Explorer 9
Press F12 to load up Developer Tools
Switch the browser mode to IE7
Running your code through a Javascript static analysis tool like JSLint can catch some common IE7 errors, such as trailing commas in object definitions.
IE8 Developer Tools are able to switch to IE7 mode
If you still need to Debug IE 7, the emulation mode of IE 11 is working pretty well.
Go to menu: Dev Tools, then to emulation and set it.
It also gives error line information.
The following tools works great for me:
1) http://www.debugbar.com/
Provide a convenience UI to with feature like source, style, DOM, Script, HTML check. It also show the actual error in your JS file (which line, which file).
2) http://www.my-debugbar.com/wiki/CompanionJS/Installing
Provide a console for IE6 or IE7 ( which originally does not support)
Screenshot

Categories

Resources