From cddc2caf53e2fe99ce5d3f1f0a9b56ff3f3ef1a0 Mon Sep 17 00:00:00 2001 From: "mstoltz%netscape.com" Date: Wed, 11 Jul 2001 01:42:35 +0000 Subject: [PATCH] Checking in 88153 on behalf of jesse@netscape.com. Making Components.manager.autoRegister callable by untrusted scripts, but parameters will be ignored. r=mstoltz, sr=jst. git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99031 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/browser/resources/content/pageInfo.js | 17 +++++++++++++++-- .../xpfe/browser/resources/content/pageInfo.xul | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mozilla/xpfe/browser/resources/content/pageInfo.js b/mozilla/xpfe/browser/resources/content/pageInfo.js index c43877f097e..49fe5d8eb3b 100644 --- a/mozilla/xpfe/browser/resources/content/pageInfo.js +++ b/mozilla/xpfe/browser/resources/content/pageInfo.js @@ -163,18 +163,31 @@ function makeImageTree(page, root) function onImageSelect() { - var tree = document.getElementById("imageTree"); var imageFrame = document.getElementById("imageFrame"); + imageFrame.setAttribute("src", "about:blank"); + + var tree = document.getElementById("imageTree"); if (tree.selectedItems.length == 1) { var clickedRow = tree.selectedItems[0].firstChild; var firstCell = clickedRow.firstChild; var imageUrl = firstCell.getAttribute("label"); - imageFrame.setAttribute("src", imageUrl); + + /* The image has to be placed after a setTimeout because of bug 62517. */ + setTimeout(placeImage, 0, imageFrame, imageUrl); } } +function placeImage(imageFrame, imageUrl) +{ + var imageDoc = imageFrame.contentDocument; + var imageNode = imageDoc.createElement("img"); + imageNode.setAttribute("src", imageUrl); + + imageDoc.documentElement.appendChild(imageNode); +} + function BrowserClose() { window.close(); diff --git a/mozilla/xpfe/browser/resources/content/pageInfo.xul b/mozilla/xpfe/browser/resources/content/pageInfo.xul index 50163590adc..47a9b362e26 100644 --- a/mozilla/xpfe/browser/resources/content/pageInfo.xul +++ b/mozilla/xpfe/browser/resources/content/pageInfo.xul @@ -139,7 +139,7 @@ -