Bug 510523 - Checking "Remember for this site" stops prompt from working on file:// URIs. r=dougt/gavin

This commit is contained in:
Martin McNickle
2009-12-13 14:38:16 -08:00
parent c370180da4
commit 06d076b9ea

View File

@@ -1228,7 +1228,14 @@ GeolocationPrompt.prototype = {
var inPrivateBrowsing = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService).
privateBrowsingEnabled;
if (!inPrivateBrowsing) {
// don't show "Remember for this site" checkbox for file:
var host;
try {
host = request.requestingURI.host;
} catch (ex) {}
if (!inPrivateBrowsing && host) {
var checkbox = newBar.ownerDocument.createElementNS(XULNS, "checkbox");
checkbox.className = "rememberChoice";
checkbox.setAttribute("label", browserBundle.GetStringFromName("geolocation.remember"));