From 19e18001a906b75fd7383291307e72eca14d70b2 Mon Sep 17 00:00:00 2001 From: thlo Date: Thu, 27 Dec 2012 22:24:51 +0100 Subject: Increase robustness (main part of code runs in chrome now). Bug fixes. --- smarttv-client/Javascript/Network.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'smarttv-client/Javascript/Network.js') diff --git a/smarttv-client/Javascript/Network.js b/smarttv-client/Javascript/Network.js index 1dfcafc..b4c0772 100755 --- a/smarttv-client/Javascript/Network.js +++ b/smarttv-client/Javascript/Network.js @@ -1,18 +1,25 @@ var Network = { plugin : null, ownMac : "", - ownGw : "" + ownGw : "", + isInited: false }; Network.init = function () { this.plugin = document.getElementById("pluginNetwork"); - var nw_type = this.plugin.GetActiveType(); - if ((nw_type == 0) || (nw_type == 1)) { - this.ownMac = this.plugin.GetMAC(nw_type); - this.ownGw = this.plugin.GetGateway(nw_type); + try { + var nw_type = this.plugin.GetActiveType(); + if ((nw_type == 0) || (nw_type == 1)) { + this.ownMac = this.plugin.GetMAC(nw_type); + this.ownGw = this.plugin.GetGateway(nw_type); + } + Main.log( "ownMac= " + this.ownMac); + Main.log ("ownGw= " + this.ownGw); + this.isInited = true; + } + catch (e) { + // Code for Non Samsung SmartTV here } - alert( "ownMac= " + this.ownMac); - alert ("ownGw= " + this.ownGw); } ; -- cgit v1.2.3