Debugging in Opera

J

Jeremy

I really want to make my scripts work in Opera. I really, really do.
But it seems like an uphill struggle. First of all, I can't get ANY
kind of debug output. No error messages in the "javascript console" -
but then, I have never seen ANYTHING in Opera's javascript console. Is
there some kind of voodoo I need to perform in order to make that work?

Then, when Opera doesn't like something about a script (even if it works
fine in Spidermonkey), it will sometimes refuse to load it entirely,
which means I can't even do alert() based debugging. What the hell?

Can anyone give me some insight as to how they go about making their
scripts run properly in Opera? I make a point of sticking to ECMAScript
standards (and then making per-browser exceptions where needed *COUGH
IE*), but Opera just doesn't want to cooperate.

This is in Opera 8, by the way. I haven't upgraded yet, since I don't
use it, and I think more people still use 8 than 9 so that's what I want
to target.


Thanks,
Jeremy
 
L

Laurent Bugnion

Hi,

Fred said:
I had similar problems with Opera and concluded it just isn't worth the
hassle. I get this impression Opera isn't gaining a much wider user base
and that it probably won't grow much further considering its closed source,
and so I've have simply chosen to discount testing on it altogether.

FWIW, Opera Mobile seems to be quite innovative. It runs on mobile
platforms (supporting Java ME) and claims to support Web services. I
didn't keep score, but I think they're the first mobile browser doing so.

I didn't test though.

Greetings,
Laurent
 
F

Fred Lazy

use it, and I think more people still use 8 than 9 so that's what I want
to target.

I had similar problems with Opera and concluded it just isn't worth the
hassle. I get this impression Opera isn't gaining a much wider user base
and that it probably won't grow much further considering its closed source,
and so I've have simply chosen to discount testing on it altogether.
 
R

Richard Cornford

Jeremy said:
I really want to make my scripts work in Opera. I really,
really do. But it seems like an uphill struggle. First of
all, I can't get ANY kind of debug output. No error messages
in the "javascript console" - but then, I have never seen
ANYTHING in Opera's javascript console. Is there some kind
of voodoo I need to perform in order to make that work?

Preferences... -> Advances-> JavaScript options... -> Check "Open
JavaScript console on error", works much as you would expect on Opera 8
and outputs pretty informative error messages most of the time.
Then, when Opera doesn't like something about a script
(even if it works fine in Spidermonkey), it will sometimes
refuse to load it entirely,

I haven't seen that with Opera, at least not recently. Opera 6 had a
problem with scripts that accidentally included the non-breaking space
character instead of real spaces.
which means I can't even do alert() based debugging.
What the hell?

If you can present a test-case someone will be able to tell you why.
Can anyone give me some insight as to how they go about
making their scripts run properly in Opera?

I have always just written cross-browser code and the rustles mostly
work in Opera straight away (minor quirks like Opera not being happy
with DOM tree re-organisation prior page load needing a little working
around).
I make a point of sticking to ECMAScript standards

The W3C DOM standard is probably at least as significant (Opera's ECMA
262 support is as near faultless as any). However, many people make the
mistake of thinking that because Mozilla/Gecko has the fullest W3C DOM
support that whatever works in Mozilla/Gecko must be DOM standard code,
that is not a valid assumption.
(and then making per-browser exceptions where
needed *COUGH IE*), but Opera just doesn't want
to cooperate.

Yes they do (having been personally contacted by Opera's QA department I
am absolute certain that they care a great deal about their script
support).
This is in Opera 8, by the way. I haven't upgraded yet,
since I don't use it, and I think more people still use 8
than 9 so that's what I want to target.

There is a mindset in 'that is the one I want to target' that will get
in the way of your writing cross-browser scripts. A cross-browser public
Internet script should be designed to meaningfully cope with whatever
browser it encounters (including the non-scriptable ones). Learn how to
do that and you can stop thinning in terms of targeting browsers, and at
the same time discover that you can easily crate scripts that will
actively work as designed on any browser that provides the
features/facilities that the script needs.

Richard.
 
J

Jeremy

Preferences... -> Advances-> JavaScript options... -> Check "Open
JavaScript console on error", works much as you would expect on Opera 8
and outputs pretty informative error messages most of the time.

I actually tried this as well. The console pops up, but it's empty.
The W3C DOM standard is probably at least as significant (Opera's ECMA
262 support is as near faultless as any). However, many people make the
mistake of thinking that because Mozilla/Gecko has the fullest W3C DOM
support that whatever works in Mozilla/Gecko must be DOM standard code,
that is not a valid assumption.

Whenever my script doesn't work, I check everything against the W3
standards and the ECMA standards to make sure it's on the up-and-up.
Even so, I can rarely get opera to work (although sometimes I find it
does work even when I haven't been testing in it - it's a crapshoot).
Yes they do (having been personally contacted by Opera's QA department I
am absolute certain that they care a great deal about their script
support).

I was referring to Opera the browser, not the company :) I have a
habit of anthropomorphism when it comes to software.

Anyway, perhaps there is something wrong with my Opera installation
that's preventing the javascript console from working. Perhaps I'll
upgrade to version 9 in the hopes that it will fix this.

Thanks for your tips, too.

Jeremy
 
L

Lasse Reichstein Nielsen

Jeremy said:
I actually tried this as well. The console pops up, but it's empty.

Do you have any filtering selected?
I don't remember how (I'm using Opera 9 now), but I seem to remember
that you could filter the javascript console in v8 too.
Whenever my script doesn't work, I check everything against the W3
standards and the ECMA standards to make sure it's on the
up-and-up. Even so, I can rarely get opera to work (although sometimes
I find it does work even when I haven't been testing in it - it's a
crapshoot).


I use Opera as my primary browser and I don't remember having to do
anything special to get standards compliant code to work. I would love
to see some examples of standard code that fails.

Mind you, there are quite a lot of things that the DOM standard
doesn't deal with :)

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top