Bug 345993 - Make the full Build ID more accessible to testers. patch=zach, r=rob_strong, sr=jst

This commit is contained in:
rob_strong%exchangecode.com 2006-07-31 21:30:16 +00:00
Родитель f2ac5c5767
Коммит 8fd3f51fc5
3 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -39,7 +39,7 @@
#include "domstubs.idl"
[scriptable, uuid(8758b72b-63d4-4685-b908-4275126410fb)]
[scriptable, uuid(8e150a70-3e51-45df-bee3-77505fbe016c)]
interface nsIDOMNavigator : nsISupports
{
readonly attribute DOMString appCodeName;
@ -58,6 +58,7 @@ interface nsIDOMNavigator : nsISupports
readonly attribute DOMString userAgent;
readonly attribute boolean cookieEnabled;
readonly attribute boolean onLine;
readonly attribute DOMString buildID;
boolean javaEnabled();
boolean taintEnabled();

Просмотреть файл

@ -186,6 +186,8 @@
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
#include "nsBuildID.h"
nsIFactory *nsGlobalWindow::sComputedDOMStyleFactory = nsnull;
static nsIEntropyCollector *gEntropyCollector = nsnull;
@ -7876,6 +7878,18 @@ nsNavigator::GetOnLine(PRBool* aOnline)
return NS_OK;
}
NS_IMETHODIMP
nsNavigator::GetBuildID(nsAString& aBuildID)
{
nsresult rv = NS_ERROR_FAILURE;
long buildID = NS_BUILD_ID;
if (buildID) {
aBuildID = NS_LITERAL_STRING(NS_STRINGIFY(NS_BUILD_ID));
rv = NS_OK;
}
return rv;
}
NS_IMETHODIMP
nsNavigator::JavaEnabled(PRBool *aReturn)
{

Просмотреть файл

@ -75,7 +75,10 @@
var list = document.getElementById("aboutPageList");
var listItem = list.appendChild(document.createElement("li"));
listItem.appendChild(document.createTextNode("&about.buildIdentifier;"));
listItem.appendChild(document.createTextNode(ua));
// replace the shortened 8-digit build id in the UA with the full 10-digit
// build id from navigator.buildID
var newUA = ua.replace(/\/\d{8}/, navigator.buildID);
listItem.appendChild(document.createTextNode(newUA));
}
</script>
</ul>