Coolest Opera Bug Ever!
Thursday, August 2, 2012 1:21:27 PM
Reported as: DSK-371190
If you access a page with a domain name having 9 characters and using ajax requests, browser.js will match it as 'staple.com'. The result is an awful error:
The problem is this if in browser.js:
And hostname.endsWith does:
What actually happens here is that a domain name's length is represented by this.value.length.
The variable "str" is 'staple.com' ans str.length equals 10.
Now, if you do a this.value.indexOf(str) that will return -1 for any domain not having 'staple.com' in it's name.
As a result 'endWith' will return true, code in the if applies and messes up the otherwise correct code on the specific site.
Opera surely will soon fix it, until then you can set browser.js to not be used, or yo can access the particular site by IP, or you can tweek the browser.js (just don't update after the tweeking).
If you access a page with a domain name having 9 characters and using ajax requests, browser.js will match it as 'staple.com'. The result is an awful error:
Error thrown at line 733, column 8 in <anonymous function>():
var elms=doc.getElementsByTagName('*'),elm,i=0
called from line 1679, column 6 in <anonymous function: initialize>(request) in https://csabastore/js/prototype.js?1343230935:
var xml = transport.responseXML;
called from line 101, column 6 in klass() in https://csabastore/js/prototype.js?1343230935:
this.initialize.apply(this, arguments);
called from line 1595, column 4 in <anonymous function: respondToReadyState>(readyState) in https://csabastore/js/prototype.js?1343230935:
var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
called from line 1545, column 6 in <anonymous function: onStateChange>() in https://csabastore/js/prototype.js?1343230935:
this.respondToReadyState(this.transport.readyState);
called via Function.prototype.apply() from line 391, column 6 in <anonymous function>() in https://csabastore/js/prototype.js?1343230935:
return __method.apply(context, a);
The problem is this if in browser.js:
LINE 728: } else if(hostname.endsWith('staples.com')){ .... }
And hostname.endsWith does:
LINE 32: endsWith:function(str){ return this.value.length==this.value.indexOf(str)+str.length;
What actually happens here is that a domain name's length is represented by this.value.length.
The variable "str" is 'staple.com' ans str.length equals 10.
Now, if you do a this.value.indexOf(str) that will return -1 for any domain not having 'staple.com' in it's name.
As a result 'endWith' will return true, code in the if applies and messes up the otherwise correct code on the specific site.
Opera surely will soon fix it, until then you can set browser.js to not be used, or yo can access the particular site by IP, or you can tweek the browser.js (just don't update after the tweeking).







Unregistered user # Thursday, August 2, 2012 1:29:54 PM
Patkós Csabapatkoscsaba # Thursday, August 2, 2012 5:37:15 PM