diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index a89448e54d10..fd7417cb6cae 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -188,17 +188,6 @@ function UpdateBackForwardButtons() } } -function UpdatePageReport(event) -{ - if (!gReportButton) - return; - - if (gBrowser.mCurrentBrowser.pageReport) - gReportButton.setAttribute("blocked", "true"); - else - gReportButton.removeAttribute("blocked"); -} - function RegisterTabOpenObserver() { const observer = { @@ -223,10 +212,7 @@ function Startup() gBrandBundle = document.getElementById("bundle_brand"); gBrowser = document.getElementById("content"); gURLBar = document.getElementById("urlbar"); - gReportButton = document.getElementById("page-report-button"); - - gBrowser.addEventListener("DOMUpdatePageReport", UpdatePageReport, false); - + var toolbox = document.getElementById("navigator-toolbox"); toolbox.customizeDone = BrowserToolboxCustomizeDone; @@ -579,14 +565,8 @@ function updateGoMenu(goMenu) destroyGoMenuItems(goMenu); var history = document.getElementById("hiddenHistoryTree"); - - if (history.hidden) { + if (history.hidden) history.hidden = false; - var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"] - .getService(Components.interfaces.nsIGlobalHistory); - var dataSource = globalHistory.QueryInterface(Components.interfaces.nsIRDFDataSource); - history.database.AddDataSource(dataSource); - } if (!history.ref) history.ref = "NC:HistoryRoot"; @@ -3144,12 +3124,6 @@ function displayPageInfo() "dialog=no", null, "securityTab"); } -function displayPageReport() -{ - window.openDialog("chrome://browser/content/pageReport.xul", "_blank", - "dialog=no"); -} - const mediatorContractId = "@mozilla.org/appshell/window-mediator;1"; const nsIWebBrowserChrome = Components.interfaces.nsIWebBrowserChrome; diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index c5f8b676d646..486871070342 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -321,6 +321,9 @@ Contributor(s): label="&setWallpaperCmd.label;" accesskey="&setWallpaperCmd.accesskey;" oncommand="gContextMenu.setWallpaper();"/> + - \ No newline at end of file + + + \ No newline at end of file diff --git a/toolkit/content/nsContextMenu.js b/toolkit/content/nsContextMenu.js index a22036084f74..2720237dd211 100644 --- a/toolkit/content/nsContextMenu.js +++ b/toolkit/content/nsContextMenu.js @@ -33,6 +33,7 @@ | Currently, this code is relatively useless for any other purpose. In the | | longer term, this code will be restructured to make it more reusable. | ------------------------------------------------------------------------------*/ +const IMAGEPERMISSION = 1; function nsContextMenu( xulMenu ) { this.target = null; this.menu = null; @@ -100,7 +101,7 @@ nsContextMenu.prototype = { this.showItem( "context-reload", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); this.showItem( "context-stop", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); - this.showItem( "context-sep-stop", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); + this.showItem( "context-sep-stop", !( this.isTextSelected || this.onLink || this.onTextInput ) ); // XXX: Stop is determined in navigator.js; the canStop broadcaster is broken //this.setItemAttrFromNode( "context-stop", "disabled", "canStop" ); @@ -147,6 +148,11 @@ nsContextMenu.prototype = { this.showItem( "context-searchselect", this.isTextSelected ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); + this.showItem( "context-blockimage", this.onImage); + if (this.onImage) { + var blockImage = document.getElementById("context-blockimage"); + blockImage.checked = this.isImageBlocked(); + } }, initClipboardItems : function () { @@ -527,6 +533,18 @@ nsContextMenu.prototype = { saveImage : function () { saveURL( this.imageURL, null, "SaveImageTitle", false ); }, + toggleImageBlocking : function (aBlock) { + var permissionmanager = + Components.classes["@mozilla.org/permissionmanager;1"] + .getService(Components.interfaces.nsIPermissionManager); + permissionmanager.add(this.imageURL, !aBlock, IMAGEPERMISSION); + }, + isImageBlocked : function() { + var permissionmanager = + Components.classes["@mozilla.org/permissionmanager;1"] + .getService(Components.interfaces.nsIPermissionManager); + return permissionmanager.testForBlocking(this.imageURL, IMAGEPERMISSION); + }, // Generate email address and put it on clipboard. copyEmail : function () { // Copy the comma-separated list of email addresses only.