Closed Bug 380422 Opened 17 years ago Closed 17 years ago

The evaluating iframe may contain nuts (and other remainders)

Categories

(Toolkit Graveyard :: Error Console, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha5

People

(Reporter: zeniko, Assigned: zeniko)

References

Details

Attachments

(1 file, 1 obsolete file)

(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.
No longer depends on: 238898
Attached patch fix (obsolete) — Splinter Review
Attachment #264505 - Flags: review?(gavin.sharp)
Attachment #264505 - Flags: superreview?(neil)
Attachment #264505 - Flags: review?(gavin.sharp)
Attachment #264505 - Flags: review+
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+
... but keeping |evaluator| lower-cased as all other variables are.
Attachment #264505 - Attachment is obsolete: true
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.
mozilla/toolkit/components/console/content/console.js         1.8
mozilla/xpfe/components/console/resources/content/console.js  1.27
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Version: unspecified → Trunk
This caused bug 386501.
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.

Attachment

General

Creator:
Created:
Updated:
Size: