Issue #053 [WontFix/closed] - Javascript error in Opera

Posted by wrtlprnft

What steps will reproduce the problem?

  1. load any page using webiopi.js in opera
  2. JS error in webiopi.js:33: a.substr is not a function

WebIOPi version used? => 0.6

For Javascript side bugs, Browser? => opera 12.15

Please provide any additional information below.

I think this piece of code in webiopi.js:42 can never work:

(window.opera != undefined && isMobileUserAgent(window.opera))

window.opera is not a string object, hence it makes no sense to call substr.

With that check removed, everything seems to work. Browser detection should still work with navigator.userAgent.

Files attached

Comment 1

Posted by trouch

Comment 2

Posted by trouch

Comment 3

Posted by trouch

Comment 4

Posted by trouch

No error with Opera 19