2011-12-14 11 views
1

私はローカルの.xmlファイルを使用するFirefox拡張機能を読み書きしています。Firefoxの拡張機能から安全な場所にファイルを書き込もうとしていますか?

私はコードに問題はなく、テスト用のデスクトップディレクトリを使用して自分のPCで正常に動作しますが、書込みしようとするとアクセス権の問題が発生する可能性があるため、いくつかのPC上のファイル。私は、私が使用することができ、これらのディレクトリを参照mozilla.orgで

String Meaning 
ProfD profile directory 
DefProfRt user (for example /root/.mozilla) 
UChrm %profile%/chrome 
DefRt %installation%/defaults 
PrfDef %installation%/defaults/pref 
ProfDefNoLoc %installation%/defaults/profile 
APlugns  %installation%/plugins 
AChrom %installation%/chrome 
ComsD %installation%/components 
CurProcD installation (usually) 
Home OS root (for example /root) 
TmpD OS tmp (for example /tmp) 
ProfLD Local Settings on windows; where the network cache and fastload files are stored 
resource:app application directory in a XULRunner app 
Desk Desktop directory (for example ~/Desktop on Linux, C:\Documents and Settings\username\Desktop on Windows) 
Progs User start menu programs directory (for example C:\Documents and Settings\username\Start Menu\Programs) 

は、誰かが配布のためのリリースのために使用するための最良の選択肢だろうかを知っているでしょうか?私はすべての利用可能なフォルダのいずれかが常に任意のPC上の書き込み権限を持っていることを意味ですか?

答えて

4

拡張機能は通常、ユーザーのプロファイルディレクトリ(ProfD)にのみ書き込む必要があります。複数のファイルをお持ちの場合は、そのディレクトリの拡張ディレクトリを作成する方がよいでしょう。それが単一のファイルの場合は、それがどの拡張子に属しているかを明白にする方法で名前を付けるようにしてください。