+ private void initLiveConnect()
+ {
+ // try really hard to get the liveConnect thing working
+ boolean notFailed = false;
+ int tries = 0;
+ while (!notFailed && tries < 10)
+ {
+ if (tries > 0)
+ {
+ System.err.println("LiveConnect request thread going to sleep.");
+ }
+ try
+ {
+ Thread.sleep(700 * (1 + tries));
+ } catch (InterruptedException q)
+ {
+ }
+ ;
+ if (tries++ > 0)
+ {
+ System.err.println("LiveConnect request thread woken up.");
+ }
+ try
+ {
+ JSObject scriptObject = JSObject.getWindow(this);
+ if (scriptObject.eval("navigator") != null)
+ {
+ notFailed = true;
+ }
+ } catch (JSException jsex)
+ {
+ System.err.println("Attempt " + tries
+ + " to access LiveConnect javascript failed.");
+ }
+ }
+ }
+