/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.bin;
import java.util.StringTokenizer;
import java.util.Vector;
+import netscape.javascript.JSException;
import netscape.javascript.JSObject;
/**
callInitCallback();
}
}
-
+ 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.");
+ }
+ }
+ }
private void callInitCallback()
{
String initjscallback = getParameter("oninit");
{
}
;
+ // try really hard to let the browser plugin know we want liveconnect
+ initLiveConnect();
+
if (scriptObject != null)
{
try