今度こそid3v23.jsをFirefox3で動くように修正
id3v23.jsをFirefox3で動くように修正したつもりで、たしかにダウンロードが始まるようにはなっていたのだけど、ダウンロードがちゃんと完了しない状態になっていたのに気がついたので直しました。
ダウンロードはMySpaceのMP3ファイルにID3tagを埋め込みつつダウンロードするJSActionsスクリプトのページで。
なおしたところ
nsIWebBrowserPersistじゃなくてnsIChannelをnsIDownloadManager管理でダウンロードするのダウンロードが完了したときにダウンロードマネージャに完了を通知する部分。
- this.download.onStateChange(null, request, this.download.STATE_STOP,
+ this.download.onStateChange(null, request, this.download.STATE_STOP |
+ this.download.STATE_IS_NETWORK,
Components.results.NS_OK);
Interface Reference – nsIWebProgressListenerに
STATE_IS_NETWORK This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.
とかなんとか書いてあるけどよくわかんない。Firefox3から?のオンライン/オフラインの何かかとも思ったけど、定数の値からすると前から定義されていたものな感じがする。
ソースをonStateChangeでgrepしたらmozilla/base/content/tabbrowser.xmlに
p.onStateChange(webProgress, null, nsIWebProgressListener.STATE_STOP | nsIWebProgressListener.STATE_IS_NETWORK, 0);
という記述があったので真似して書いたら解決したのでした。

No comments
Jump to comment form | comments rss [?] | trackback uri [?]