From b611e11acddec52d44804bc9716d6a585fcfad40 Mon Sep 17 00:00:00 2001 From: Martin McNickle Date: Sat, 12 Dec 2009 13:39:26 -0800 Subject: [PATCH] Bug 510424 - Geolocation notification does not show requester of location for file:// URLs. r=dougt/gavin ui=beltzner --HG-- extra : rebase_source : 3e333d15f04581e2901906b60a19aa3d548ed7c3 --- browser/components/nsBrowserGlue.js | 12 ++++++++++-- .../locales/en-US/chrome/browser/browser.properties | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 96433769c692..76abda906bae 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1201,8 +1201,16 @@ GeolocationPrompt.prototype = { }, }]; - var message = browserBundle.formatStringFromName("geolocation.siteWantsToKnow", - [request.requestingURI.host], 1); + var message; + + // Different message/info if it is a local file + if (request.requestingURI.schemeIs("file")) { + message = browserBundle.formatStringFromName("geolocation.fileWantsToKnow", + [request.requestingURI.path], 1); + } else { + message = browserBundle.formatStringFromName("geolocation.siteWantsToKnow", + [request.requestingURI.host], 1); + } var newBar = notificationBox.appendNotification(message, "geolocation", diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index b1a7820b1ad3..909a92eae0b1 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -196,6 +196,7 @@ geolocation.shareLocation.accesskey=a geolocation.dontShareLocation=Don't Share geolocation.dontShareLocation.accesskey=o geolocation.siteWantsToKnow=%S wants to know your location. +geolocation.fileWantsToKnow=The file %S wants to know your location. # LOCALIZATION NOTE (geolocation.learnMore): Use the unicode ellipsis char, \u2026, # or use "..." if \u2026 doesn't suit traditions in your locale. geolocation.learnMore=Learn Moreā€¦