mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 502486 - Don't strip the www off urls for the block-image context menu label. r=dao, ui-r=faaborg
This commit is contained in:
parent
943115b9ac
commit
d8cc15d0c9
@ -271,6 +271,7 @@ nsContextMenu.prototype = {
|
||||
this.showItem("context-bidi-page-direction-toggle",
|
||||
!this.onTextInput && top.gBidiUI);
|
||||
|
||||
var hostLabel = "";
|
||||
if (this.onImage) {
|
||||
var blockImage = document.getElementById("context-blockimage");
|
||||
|
||||
@ -280,16 +281,14 @@ nsContextMenu.prototype = {
|
||||
|
||||
// this throws if the image URI doesn't have a host (eg, data: image URIs)
|
||||
// see bug 293758 for details
|
||||
var hostLabel = "";
|
||||
try {
|
||||
hostLabel = uri.host;
|
||||
} catch (ex) { }
|
||||
|
||||
if (hostLabel) {
|
||||
var shortenedUriHost = hostLabel.replace(/^www\./i,"");
|
||||
if (shortenedUriHost.length > 15)
|
||||
shortenedUriHost = shortenedUriHost.substr(0,15) + this.ellipsis;
|
||||
blockImage.label = gNavigatorBundle.getFormattedString("blockImages", [shortenedUriHost]);
|
||||
if (hostLabel.length > 15)
|
||||
hostLabel = hostLabel.substr(0,15) + this.ellipsis;
|
||||
blockImage.label = gNavigatorBundle.getFormattedString("blockImages", [hostLabel]);
|
||||
|
||||
if (this.isImageBlocked())
|
||||
blockImage.setAttribute("checked", "true");
|
||||
|
Loading…
Reference in New Issue
Block a user