Do I need to Worry? - "Exposing chrome JS objects..." - javascript

I keep seeing the following error in Firebug but I do not understand what it means or if it is important:
Exposing chrome JS objects to content without __exposedProps__ is insecure and deprecated. See https://developer.mozilla.org/en/XPConnect_wrappers for more information.
The link provided is a bit over my head.
My questions are:
Should I be concerned about this error on my website?
How do I prevent this error?
Can someone explain the basics of what this means in layman's terms?

According to this bug report with jQuery, it'll be an issue with FireQuery rather than anything you're doing.
Do you have FireQuery installed with Firebug? If so, try disabling it and seeing if the error still happens.

Related

Javascript - Find source of console.errors in webpage

I'm developing a React app and incorporated a few packages, some of which seem to be spitting out uncaught console.error messages despite UI and functionality working just fine. The Console output currently looks like this:
I can't seem to find anything online about this, but is there any way I can track down and silence these messages? In particular I'm looking at the one saying Failed to load resource: net::ERR_FAILED, since the others seem to be coming from the React debugger.
EDIT: The error seems to be a side effect of some sort of Adblocker/tracker blocker built into Brave. Is there anyway I can still catch that in my Javascript code?
At first glance it could be something like a cache or some extension. Since you've said that you searched for a solution online and didn't find anything, I believe you already tried these solutions, but if not, here is something you can try:
Start Chrome with your extensions disabled or start in incoginito mode (the extensions will be disabled by default).
Clean your browser cache and cookies.
If you are like me (I hope not) and open 99+ tabs in your broswer, close them, it could be a problem due lack of memory.
Check the network tab to see if Chrome failed to download any resource file.
These are the tips I can give to you, I hope it helps.

Microsoft Script Debugger does not display any information after error

I'm trying to debug a Javascript error which only occurs in Internet Explorer. I have Microsoft Script Debugger installed, and have used it successfully in the past. On this error, though, I select "Yes" to do-you-want-to-debug?, and it opens up Script Debugger, which displays nothing. Running documents window is empty, call stack is empty, as though nothing is being debugged.
Can anyone tell me what causes this?
I've had these sorts of issues before with the Microsoft Script Debugger but never managed to find a solution - if you have a license the script debugger inside Visual Studio 2008 is far far better.
There is an article here about how you can use VS 2008 Express (free) as a script debugger.
I've seen this issue with code inside a try/catch/finally block--for some reason the debugger gets confused by the finally block. Try commenting them out.
I know this is old but I thought I would point out that this is still an issue. Microsoft plain sux. Developers are being forced to support products that are broken....this is a crime

Debugging a javascript error that only occurs on the live site

Something broke and I get "Object Expected" error on my live site, but I can't figure out where. If I run visual studio at the same time, it breakpoints it and shows the error as being half way along the viewstate, highlighted yellow... which is useless as its just gobbledegook.
How can I debug this? I want to know what javascript its trying to run that is breaking it.
Firefox and Firebug.
http://getfirebug.com/
Never debug Javascript without it.
Check out ScriptCanary.com so you can get all the details from live site errors and vastly improve your chances of quickly fixing them.

IE and unspecified error and in IE8 object doesn't support method

I have a big (probably) javascript problem.
i have a long and complex script on the page based on mootools framework,
in FF and other browser everything works fine, but in ie 6 and 7 i got "error:153 (sometimes 84) Unspecified error" and the strange thing is in IE8 that show me the error "Object doesn't support this property or method".
someone know the possible cause of the problem? o maybe someone know a list of IE's unsupported property or method?
In IE8 you can get the line number of the error, then right-click -> view source. IE8 has a proper source, which includes script lines, so you should quickly be able to find the source of your error.
If the script you're using isn't obfuscated or all on one line, you could use the JavaScript debugger in IE8 to pinpoint the object which is causing the error. Press F12 to open the Developer Tools, go to the Script tab, and click the "Start Debugging" option. If there's an error it may well break on the relevant line. If not you can set some breakpoints and step through the code.
You can also use IE8 developer tools http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx to debug.
For other version I suggest you use Web developer tool bar which is similar to web developer tool bar for firefox.
Its near impossible to tell what the problem is with this information (at least for me).
For IE6/7 I suggest adding a few alerts to the javascript in intervals to find out exactly what line of code is causing your problem. If you know which object is causing the error, it is usually quite simple to find out what the exact problem is.
IE8 provides nice debugging tools, so that is a good place to start.
In my case the error was due to a $ mapping conflict.
Using jQuery instead of $ solved the issue.

Firefox add-on tools for checking JavaScript syntax?

Not sure if there is any Firefox add-on tool for checking JavaScript syntax, var declaration, or even pre-compiling available?
I find out is very difficult to debug JavaScript in a web html page. I have to add some script there. When the scripts get very big or long, it stops working. Basically, there must be some bugs. It is very frustrating even the load event stop working. I do need some good tools to find out the bugs.
I have tried FireBug. It is good but not enough. Maybe I don't know all its features. Anyway, I need any good suggestions.
This page may help you a bit as it also contains a screencast.
Debugging Javascript in Firefox with Firebug
It's not strictly an Add-On (although you can obviously run it in a Firefox web page), but I've found JSLint to be helpful in exposing expression anomalies that might or might not be strictly invalid syntax (although it will catch all those, too.)
My suggestion is to check you javascript with JSLint. JSLint will show you common problems in javascript code and helps you to create strict and compatible code.
YSlow includes JSLint as Tool.
As an alternative to FireBug check this debugger: Venkman JavaScript Debugger, has been out there for a while, and it's not bad at all...
I have always been a firebug fan and it sure is one of the best debuggers out there. Any JS issue Press F12, Enable the console for catching the errors and then you can find the exact line causing the error. Add a breakpoint and you can see the exact values of variables too. Very intuitive UI..just get used to using it and it will save a lot of your time.
I HIGHLY recommend Rainbow. It's still in Beta and only works in FF3, but it offers syntax highlighting. That will get you half-way there when it comes to syntax.
I constantly use firebug with a js file that has some 15000 lines. I've had no problems with it (sometimes I have to wait a few seconds for it to scroll to the breakpoint but even then it works fine).
Unfortunately JSLint does'nt work for us. We use some third party code that while beeing "valid" has unnecessary ";" according to jsLint. The code is in the beginning of our js file and jslint stops analyzing at 3% because it thinks there are too many errors (all of them unnecessary ";".)
You're missing the point on 2 counts:
First, being presented with a gazillion unnecessary error messages will make it impossible to find the problem in the first place.
Secondly, the errors are unnecessary. I used to use JSLint religiously, but now it's become too much of a code Nazi and I can't use it.
I'm aware that many of the things it checks for can be disabled, but I just don't have enough time to research what I'd have to do.
The issue is the usability of the default configuration. I, like the original poster, am just looking for a way to find true JavaScript syntax errors very quickly, including on HTML pages. I'm sure that Firebug can do it, but as in the case with JSLint, I don't have the spare time to find out how.
I do, however, use Firebug for debugging, though the version I'm using (1.10.3) has a bad habit of displaying errors, but reporting an incorrect file and line number.
Hi Gene: you could change one variable option.maxerr inside your jslint.js file into the number you want.
The default value is 50, you could change it to 500 or 1000 to suite your taste.
I use both the following for code validation.
JSHint # http://jshint.com
JSLint FF Plugin. Get at https://addons.mozilla.org/en-us/firefox/addon/jslinter/
Alternatively, jshint and jslint plugins are available for text editors like Notepad ++, sublime etc.

Categories

Resources