Posted by
XP1 on
Aug 06, 2011; 11:47pm
URL: https://support.nabble.com/Opera-Web-Browser-Problem-tp5632156p6660657.html
Hugo <Nabble> wrote
So we think it is not worth adding extra code just to turnaround the bugs from Opera.
How do you know it is an Opera bug? Are you just assuming it is? Assuming that it is Opera's fault is wrong because most of the time, it is the web developer's fault.
This is true in this case because, as it turns out, Nabble's evil browser sniffing is causing this bug -- only in Opera because Nabble checks "if ($.browser.opera)".
Extra code is not the answer. Negative lines of code is the answer. Remove the evil browser sniffing.
Here is the forum thread about Nabble in the My Opera forums:
http://my.opera.com/community/forums/topic.dml?id=1067742Yesterday, I was wrong to ignore "Javascript.jtp". There is another "Nabble.resizeFrames()" function in there. ಠ_ಠ
Nabble.resizeFrames = function(h, scroll) {
if (Nabble.getParent().nabbleresize) {
var height = h && typeof h == 'number'? h : Math.max(Nabble.getMyHeight() + 25, 600);
var validHeight = Nabble.isValidHeight(height);
height = validHeight? height : Nabble.heightLimit;
var js = [], key = [];
if (scroll) {
js.push("Nabble.scroll(" + scroll + ");");
key.push("scrolljs");
}
if (height != $(window).height()) {
js.push("Nabble.resizeFrames(" + height + "," + Nabble.quote(document.title) + "," + validHeight + ");");
key.push("resizejs");
}
if (js.length > 0)
Nabble.evalInTop(key, js);
}
};
http://nabble.documentfoundation.org/Javascript.jtp?v=19http://npopuk-forum.986084.n3.nabble.com/Javascript.jtp?v=19"Nabble.resizeFrames()" calls "Nabble.getMyHeight()".
Nabble.getMyHeight = function() {
try {
if ($.browser.msie) return document.body.scrollHeight;
if ($.browser.mozilla) return document.body.offsetHeight;
else if ($.browser.opera) return document.documentElement.clientHeight;
else if ($.browser.safari) return $('#nabble').height();
else return Math.max(document.body.scrollHeight, document.body.offsetHeight);
} catch(err) {}
return 500;
};
Browser sniffing code gone wrong!
Every time the frame is resized, the window height changes, so "(height != $(window).height())" will always be true.
"Nabble.resizeFrames()" will call itself recursively, nonstop.
I have created a User JS for Opera that will remove Nabble's evil browser sniffing.
Fix Nabble: Fix Nabble's frame reloading bug by removing evil browser sniffing for Opera.
https://gist.github.com/1129867/C'mon, Nabble! How many times do I have to say that evil browser sniffing is evil?
ClaudeMobetta wrote
As a web designer - I have found over the years that the ONLY browser that reads 100% of HTML code - as written - is Internet Explorer. Opera Chrome Firefox Safari Mozella etc - I have used them all and then some - DO NOT read the code 100% as written. There is always a glitch.
That is ridiculous. How can you conclude that because your code runs perfectly in Internet Explorer, it is the only browser that can read 100% of the code? What if your code is wrong? You are praising Internet Explorer without doubt for 100% of its perfect rendering -- such a ludicrous claim!
Anyway, in this case, Opera is trying to run the code that you give it -- "100% as written".
Bad code goes in; bad results come out.