The evaluating iframe may contain nuts (and other remainders)

RESOLVED FIXED in mozilla1.9alpha5

Status

Toolkit Graveyard
Error Console
--
minor
RESOLVED FIXED
10 years ago
a year ago

People

(Reporter: Simon Bünzli, Assigned: Simon Bünzli)

Tracking

Trunk
mozilla1.9alpha5

Details

Attachments

(1 attachment, 1 obsolete attachment)

2.26 KB, patch
Details | Diff | Splinter Review
(Assignee)

Description

10 years ago
(From bug 238898 comment #24)
> Hrm, this doesn't behave properly with javascript: URLs that don't cause a new
> load, e.g. evaluating ("const a=1;", "a;", "a;") will result in ("", 1, error)
> when it should result in ("", error, error), but I guess that happens currently
> too because displayResult() is only called onload. This was mentioned in bug
> 158475 comment 4, so I guess it's known. Might be worth filing a bug on it
> anyways.

Inserting the following line just before setting the location to the new javascript: URL fixes this issue:

+  iframe.contentDocument.location = "about:blank"; // reset the iframe

I'll add a patch once bug 238898 has been fixed.
(Assignee)

Updated

10 years ago
No longer depends on: 238898
(Assignee)

Comment 1

10 years ago
Created attachment 264505 [details] [diff] [review]
fix
Attachment #264505 - Flags: review?(gavin.sharp)
Attachment #264505 - Flags: superreview?(neil)
Attachment #264505 - Flags: review?(gavin.sharp)
Attachment #264505 - Flags: review+

Comment 2

10 years ago
Comment on attachment 264505 [details] [diff] [review]
fix

I'm sure what I said on IRC was to use contentWindow, not contentDocument (nsDocument simply calls GetLocation on its nsIDOMWindowInternal). But as you're repeating yourself I now prefer var Evaluator = document.getElementById("Evaluator").contentWindow; etc. sr=me with that fixed.
Attachment #264505 - Flags: superreview?(neil) → superreview+
(Assignee)

Comment 3

10 years ago
Created attachment 264518 [details] [diff] [review]
using contentWindow

... but keeping |evaluator| lower-cased as all other variables are.
Attachment #264505 - Attachment is obsolete: true
(Assignee)

Comment 4

10 years ago
This bitrots my patch to bug 369097. I'll update it after this one's been checked in.
Whiteboard: [checkin needed]
Target Milestone: --- → Firefox 3 alpha5
Attachment #264518 - Attachment is patch: true
Attachment #264518 - Attachment mime type: application/octet-stream → text/plain
(In reply to comment #2)
> (From update of attachment 264505 [details] [diff] [review])
> I'm sure what I said on IRC was to use contentWindow, not contentDocument
> (nsDocument simply calls GetLocation on its nsIDOMWindowInternal).

Oops, that's right. Sorry about that.

Comment 6

10 years ago
mozilla/toolkit/components/console/content/console.js         1.8
mozilla/xpfe/components/console/resources/content/console.js  1.27
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Version: unspecified → Trunk

Comment 7

10 years ago
This caused bug 386501.

Updated

10 years ago
Depends on: 385092
Product: Firefox → Toolkit
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.