By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,257 Members | 925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,257 IT Pros & Developers. It's quick & easy.

Debugging in Opera

P: n/a
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
Jun 28 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
> 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.
Jun 28 '06 #2

P: n/a
Hi,

Fred Lazy wrote:
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.


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
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Jun 28 '06 #3

P: n/a
Fred Lazy wrote:
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.


When doing projects for clients, I obviously defer to the client on
whether Opera support is desired. No client has ever even remotely
cared about Opera. However, I want to support as many browsers as
possible in my own personal projects, and I also think that there may
come a day when a client *does* care about Opera, and I want to be
prepared for that.

Why must they make it so difficult? I almost wish the ECMA/W3 would
come up with an extensive test suite so that ALL the browsers would have
to verify that the behavior of their ECMAScript interpreter is correct
according to the standard.

Now, it could be that my code is not as correct as I think, and that
SpiderMonkey is wrong while Opera is right. But how am I supposed to
determine this if Opera silently fails at anything but the simplest of
scripts?

Come on, Opera - I really, really want to like your browser.
Jun 28 '06 #4

P: n/a
Jeremy wrote:
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.
Jun 28 '06 #5

P: n/a
> 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
Jun 28 '06 #6

P: n/a
Jeremy <je*****@uci.edu> writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jun 29 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.