為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Programatically Get the Latest Version Number of Firefox

more options

How can I parse the version number of Firefox programatically.

So, I don't have to visit the page every time. All I would have to do is run the script, and it will give me the latest version.

http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/update/win32/en-US/

The file will always have ".complete.mar" in it. It's the only file with the word "complete" under this directory. How can I parse the version "40.0.2" from it.

How can I parse the version number of Firefox programatically. So, I don't have to visit the page every time. All I would have to do is run the script, and it will give me the latest version. http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/update/win32/en-US/ The file will always have ".complete.mar" in it. It's the only file with the word "complete" under this directory. How can I parse the version "40.0.2" from it.

所有回覆 (7)

more options

Type about:preferences#advanced<enter> in the address bar.

Under Advanced, Select Update. Select Check for updates, but let me choose whether to install them

more options

The 'all' page has a download link that includes the version, so maybe use that page instead to get the version information.

more options

What kind of script -- something that runs in Firefox itself, or Windows Powershell, or ??

Perhaps it's simpler if you are going to retrieve a page and parse it as text to use this shorter one: http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/win32/en-US/

Or you do not intend to automate it, you could just bookmark this page and look at it from time to time when you're curious: https://www.mozilla.org/firefox/releases/

more options
jscher2000 said

Yes, its Windows PowerShell script, and automate it so running the script would give the latest version of Firefox. The goal is to grab the latest file version dynamically, and download the file .mar file for manual update.

Thank you.

由 SAI157 於 修改

more options

Since PowerShell would use the internals of Windows for the page and file retrieval, you probably would have better luck on a site devoted to scripting those components.

more options
jscher2000 said

Could you please elaborate on it, the last part? I didn't quite understand it. Thank you!

more options

sayyam197 said

Could you please elaborate on it, the last part? I didn't quite understand it. Thank you!

This site has nothing to do with PowerShell.

It would be very inefficient to try to use PowerShell to automate Firefox, since PowerShell cannot read the web pages loaded in Firefox. Firefox does not provide that kind of interface to external scripts.

Therefore, you would use standard Windows components to retrieve the page, parse it, and then if desired, retrieve the download.

Therefore, this is not the right site for further discussion.