svnno****@sourc*****
svnno****@sourc*****
2007年 9月 1日 (土) 18:28:04 JST
Revision: 211 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=211 Author: flyson Date: 2007-09-01 18:28:02 +0900 (Sat, 01 Sep 2007) Log Message: ----------- Firefox 以外の環境では違うポート番号を使うようにしたのがUIに反映されていなかったのを修正 Modified Paths: -------------- trunk/bbs2chreader/components/nsBbs2chService.js Modified: trunk/bbs2chreader/components/nsBbs2chService.js =================================================================== --- trunk/bbs2chreader/components/nsBbs2chService.js 2007-09-01 09:13:53 UTC (rev 210) +++ trunk/bbs2chreader/components/nsBbs2chService.js 2007-09-01 09:28:02 UTC (rev 211) @@ -195,7 +195,21 @@ get serverURL(){ if(!this._serverURL){ - var port = this.pref.getIntPref("extensions.bbs2chreader.server_port"); + var port = 0; + try{ + var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] + .createInstance(Components.interfaces.nsIXULAppInfo); + if(appInfo.name == "Firefox"){ + port = this.pref.getIntPref("extensions.bbs2chreader.server_port"); + }else if(appInfo.name == "SeaMonkey"){ + port = this.pref.getIntPref("extensions.bbs2chreader.server_port.seamonkey"); + }else{ + port = this.pref.getIntPref("extensions.bbs2chreader.server_port.other"); + } + }catch(ex){ + port = this.pref.getIntPref("extensions.bbs2chreader.server_port.other"); + } + var spec = "http://127.0.0.1:" + port; this._serverURL = this._ioService.newURI(spec, null, null) .QueryInterface(Components.interfaces.nsIURL);