# HG changeset patch # User Eugene Ostroukhov # Date 1265160045 28800 # Node ID 278f8e3868ff795f38bf05aa9c79c9040119ccaa # Parent 42ca8399be33a021387fc7ffa1b8b1ed078a3068 Weird preview problem was fixed diff -r 42ca8399be33 -r 278f8e3868ff org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/http/WebappManager.java --- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/http/WebappManager.java Tue Feb 02 14:59:54 2010 -0800 +++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/http/WebappManager.java Tue Feb 02 17:20:45 2010 -0800 @@ -18,6 +18,8 @@ *******************************************************************************/ package org.symbian.tools.wrttools.previewer.http; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.util.Dictionary; import java.util.Hashtable; import java.util.logging.Level; @@ -122,7 +124,11 @@ public static String getHost() { if (host == null) { - host = "127.0.0.1"; //$NON-NLS-1$ + try { + host = InetAddress.getLocalHost().getHostName(); + } catch (Exception e) { + host = "127.0.0.1"; + } } return host; } diff -r 42ca8399be33 -r 278f8e3868ff org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java --- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java Tue Feb 02 14:59:54 2010 -0800 +++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java Tue Feb 02 17:20:45 2010 -0800 @@ -137,7 +137,7 @@ mozillaPrefs.setCharPref("capability.policy.default.XMLHttpRequest.setRequestHeader", "allAccess"); /* to over-ride the internet security dialog when preview browser tries to access local hard drive */ mozillaPrefs.setCharPref("capability.principal.codebase.p0.granted", "UniversalXPConnect UniversalBrowserRead"); - String location = "http://127.0.0.1:" + WebappManager.getPort(); + String location = "http://" + WebappManager.getHost() + ":" + WebappManager.getPort(); mozillaPrefs.setCharPref("capability.principal.codebase.p0.id", location); mozillaPrefs.setBoolPref("security.fileuri.strict_origin_policy", 0); } catch (Exception e) {