Closed Bug 350718 Opened 19 years ago Closed 19 years ago

[SessionStore] about:config's textbox value isn't restored anymore

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 2

People

(Reporter: zeniko, Assigned: zeniko)

References

()

Details

(Keywords: fixed1.8.1, regression)

Attachments

(2 files, 1 obsolete file)

Not sure where to file this. This bug is made visibly by SessionStore but might rather be a Core issue. Steps to reproduce: 1. Open about:config and enter text into the filter 2. Close the tab 3. Re-open that tab Expected result: The filter text is restored. This regressed with bug 345991 - before, it was possible to get the value by simply not applying an XPCNativeWrapper to about:config's document. OTOH if this can't be fixed for Firefox 2.0, the special treatment of about:config should at least marked with a note about why it doesn't work in nsSessionStore.js.
So is the problem that .value is not returning the right string? Or something else?
The problem is that .value is undefined in the first place.
Hmm... Is that object that we're doing .value on a XUL textbox or something?
That's what the DOM Inspector says. And that one is able to get to the value. "Normal" chrome however is not.
DOM inspector doesn't use XPCNativeWrapper. This means that it's exploitable if you use it on some random site, of course. ;) The problem is that .value on XUL textboxes is bound via XBL, so there's no way XPCNativeWrapper can know about it... Perhaps in the about:config case you simply want to unwrap in this code, if you're Really Sure that content can't touch it (should be true, since about:config is chrome).
Attached patch branch patchSplinter Review
Drivers: This low-risk patch fixes the regression by unwrapping about:config's document wherever needed (before bug 345991 was fixed, about:config wasn't wrapped at all - so there should be no new security concerns, see also comment #5 above). With this patch, about:config's filter is restored after a restart or after reopening a closed tab. This can be a blessing for developers and power users and should if possible be restored.
Assignee: nobody → zeniko
Status: NEW → ASSIGNED
Attachment #238234 - Flags: review?(bugs.mano)
Attachment #238234 - Flags: approval1.8.1?
Attached patch trunk patch (obsolete) — Splinter Review
Additionally to the branch patch, this patch contains the bits of the patch to bug 349961 which weren't checked in (complete removal of no longer required code concerning XPCNativeWrappers).
Attachment #238235 - Flags: review?(bugs.mano)
Comment on attachment 238234 [details] [diff] [review] branch patch r=mano. drivers: very low risk.
Attachment #238234 - Flags: review?(bugs.mano) → review+
Comment on attachment 238235 [details] [diff] [review] trunk patch >Index: browser/components/sessionstore/src/nsSessionStore.js >=================================================================== { >+ var data = aBrowser.parentNode.__SS_text[textarea]; > if (!data.cache) { > // update the text element's value before adding it to the data structure >- data.cache = encodeURI(data.element.value); >+ data.cache = encodeURI(textarea.value); > } > text.push(data.id + "=" + data.cache); > } > } Explain this change please (in particular, the use of textarea.value).
(In reply to comment #9) > Explain this change please (in particular, the use of textarea.value). Currently there are two references to the text areas to be saved: the keys to __SS_text and the .element field of the corresponding object. This patch does away with the redundant .element field and directly uses the reference used as key. So instead of |data.element| we now write |textarea| and thus |data.element.value| becomes |textarea.value|. Originally data.element held a wrapped instance of the textarea while the unwrapped instance was used as a key. Since tanks to bug 345991 we now automatically get everything wrapped, this dichotomy has become obsolete.
branch patch -> RC1 radar
Flags: blocking-firefox2?
Whiteboard: [has patch][needs approval]
Target Milestone: --- → Firefox 2
not a blocker, will evaluate patch separately.
Flags: blocking-firefox2? → blocking-firefox2-
Comment on attachment 238234 [details] [diff] [review] branch patch a=mconnor on behalf of drivers for 1.8 branch checkin
Attachment #238234 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [has patch][needs approval] → [checkin needed (1.8 branch)]
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
Comment on attachment 238235 [details] [diff] [review] trunk patch Tested in http://forums.mozillazine.org/posting.php?mode=newtopic&f=38 1. Write something in the message-body field. 2. Blur it 3. Crash and reopen the browser The restored value is "undefined".
Attachment #238235 - Flags: review?(mano) → review-
Attached patch trunk patchSplinter Review
Never mind, please just land the bits which landed on the branch and leave the rest for future (if ever) cleanup. Thanks.
Attachment #238235 - Attachment is obsolete: true
Attachment #240656 - Flags: review?(mano)
Comment on attachment 240656 [details] [diff] [review] trunk patch r=mano
Attachment #240656 - Flags: review?(mano) → review+
Whiteboard: [checkin needed]
mozilla/browser/components/sessionstore/src/nsSessionStore.js 1.52 Is this now FIXED?
Whiteboard: [checkin needed]
Adjusting the summary to make this bug FIXED. Note to self: Depending on the fix to bug 355766 we might want to adjust the solution chosen here.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Summary: No way to programmatically access about:config's textbox value → [SessionStore] about:config's textbox value isn't restored anymore
Component: General → Session Restore
QA Contact: general → session.restore
Verified with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2a1pre) Gecko/20090618 Minefield/3.6a1pre ID:20090618031329
Status: RESOLVED → VERIFIED
Flags: in-litmus?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: