Closed
Bug 345898
Opened 19 years ago
Closed 17 years ago
Add error handling to getClosedTabCount
Categories
(Firefox :: Session Restore, defect)
Firefox
Session Restore
Tracking
()
VERIFIED
FIXED
Firefox 3.1b2
People
(Reporter: zeniko, Assigned: zeniko)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file, 9 obsolete files)
|
12.81 KB,
patch
|
Details | Diff | Splinter Review |
... and at least undoCloseTab is missing a check for the existence of aWindow.__SSi as well.
Comment 1•19 years ago
|
||
Adds more error handling to the areas originally reported, as well as others.
With SS disabled the behavior should be:
- open history menu - expected behavior: RCT menu disabled, no errors in console
- view tab context menu - expected behavior: no "undo close tab" menuitem, no errors in console
- cmd|ctl+shift+t to undo-close-tab: expected behavior: most recently closed tab is not re-opened, no errors in console
| Assignee | ||
Comment 2•19 years ago
|
||
(In reply to comment #1)
> - open history menu - expected behavior: RCT menu disabled, no errors in
> console
Why not completely hide it in this case, as we do with the item in the tab context menu?
Furthermore, you could just remove the method closedTabNameAt. It's not part of the API (we use getClosedTabData instead) and never used internally.
Comment 3•19 years ago
|
||
(In reply to comment #2)
> (In reply to comment #1)
> > - open history menu - expected behavior: RCT menu disabled, no errors in
> > console
>
> Why not completely hide it in this case, as we do with the item in the tab
> context menu?
>
> Furthermore, you could just remove the method closedTabNameAt. It's not part of
> the API (we use getClosedTabData instead) and never used internally.
>
Thanks Simon, both suggestions are implemented in the new patch.
Attachment #239626 -
Attachment is obsolete: true
Attachment #239693 -
Flags: review?(mano)
Attachment #239626 -
Flags: review?(mano)
| Assignee | ||
Comment 4•19 years ago
|
||
(In reply to comment #3)
> Created an attachment (id=239693) [edit]
This patch consists only of the browser.js changes. Anyway, I'd just check once for browser.sessionstore.enabled per window, since that pref only has an effect at startup, so changing it in between won't enable/disable SessionStore.
Comment 5•19 years ago
|
||
Comment on attachment 239693 [details] [diff] [review]
fix + comment #2 suggestions
Gah, forgot a file in the diff.
Attachment #239693 -
Flags: review?(mano)
Comment 6•19 years ago
|
||
(In reply to comment #4)
> (In reply to comment #3)
> > Created an attachment (id=239693) [edit]
>
> This patch consists only of the browser.js changes. Anyway, I'd just check once
> for browser.sessionstore.enabled per window, since that pref only has an effect
> at startup, so changing it in between won't enable/disable SessionStore.
>
good suggestion, i added this to the patch.
Attachment #239693 -
Attachment is obsolete: true
Attachment #240161 -
Flags: review?(mano)
Comment 7•19 years ago
|
||
Comment on attachment 240161 [details] [diff] [review]
fix v3 - addresses comments #2, #4
I really don't like this true|false|null modes thing, just initialize the global variable when the window opens (FWIW, I don't think this is worth an observer).
Attachment #240161 -
Flags: review?(mano) → review-
Comment 8•19 years ago
|
||
(In reply to comment #7)
> (From update of attachment 240161 [details] [diff] [review] [edit])
> I really don't like this true|false|null modes thing, just initialize the
> global variable when the window opens
ok, now just using a global var.
> (FWIW, I don't think this is worth an
> observer).
>
what doesn't need an observer?
Attachment #240161 -
Attachment is obsolete: true
Attachment #240962 -
Flags: review?
Updated•19 years ago
|
Attachment #240962 -
Flags: review? → review?(mano)
Updated•19 years ago
|
Attachment #240962 -
Attachment is obsolete: true
Attachment #240962 -
Flags: review?(mano)
Comment 9•19 years ago
|
||
Attachment #240997 -
Flags: review?(mano)
Comment 10•19 years ago
|
||
Comment on attachment 240997 [details] [diff] [review]
v5 - proper separator handling
Could you simplify this a bit by using a shared broadcaster for all those items and set the hidden attribute on it?
http://www.xulplanet.com/tutorials/xultu/broadob.html
Comment 11•19 years ago
|
||
(In reply to comment #10)
> (From update of attachment 240997 [details] [diff] [review] [edit])
> Could you simplify this a bit by using a shared broadcaster for all those items
> and set the hidden attribute on it?
>
> http://www.xulplanet.com/tutorials/xultu/broadob.html
>
New patch, using a broadcaster. This works fine when hiding elements, but not when disabling. I tried using a broadcaster and a command (which should be functionally equivalent from what i can tell), and setting @disable=true didn't flow to the menus in either case. Is @disable a special case, or is this user-error? or a bug?
Attachment #240997 -
Attachment is obsolete: true
Attachment #240997 -
Flags: review?(mano)
Comment 12•19 years ago
|
||
Updated patch with the nonsense line fixed. However, I'm still not able to disable the menu via the broadcaster :(
Attachment #241347 -
Attachment is obsolete: true
| Assignee | ||
Updated•19 years ago
|
Component: General → Session Restore
QA Contact: general → session.restore
Updated•17 years ago
|
Assignee: dietrich → nobody
Status: ASSIGNED → NEW
| Assignee | ||
Comment 15•17 years ago
|
||
Throwing the error code really seems like the only way of reaching JavaScript callers which AFAICT so far have been the majority of our users.
Attachment #334674 -
Flags: review?(dietrich)
| Assignee | ||
Comment 16•17 years ago
|
||
Assignee: nobody → zeniko
Attachment #334674 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #335580 -
Flags: review?(dietrich)
Attachment #334674 -
Flags: review?(dietrich)
Updated•17 years ago
|
Attachment #335580 -
Flags: review?(dietrich) → review+
| Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Comment 17•17 years ago
|
||
This patch is bitrottted now. Need a new patch here.
Keywords: checkin-needed
Whiteboard: [needs new patch]
| Assignee | ||
Comment 18•17 years ago
|
||
Unbitrotted and with a cleaned-up version of undoCloseTab (harmonized in style with the rest of the API methods).
Attachment #241877 -
Attachment is obsolete: true
Attachment #335580 -
Attachment is obsolete: true
| Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Whiteboard: [needs new patch]
Comment 19•17 years ago
|
||
Comment on attachment 342742 [details] [diff] [review]
for check-in
[Checkin: Comment 19]
http://hg.mozilla.org/mozilla-central/rev/5c8163ad17aa
Attachment #342742 -
Attachment description: for check-in → for check-in
[Checkin: Comment 19]
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.1b2
Version: unspecified → Trunk
Comment 20•17 years ago
|
||
> duplicateTab: function sss_duplicateTab(aWindow, aTab) {
> if (!aTab.ownerDocument || !aTab.ownerDocument.defaultView.__SSi ||
> !aWindow.getBrowser)
> throw (Components.returnCode = Cr.NS_ERROR_INVALID_ARG);
there is aWindow.getBrowser in duplicateTab function
it should be aWindow.getBrowser() or aWindow.gBrowser
Comment 21•17 years ago
|
||
(In reply to comment #20)
> > duplicateTab: function sss_duplicateTab(aWindow, aTab) {
> > if (!aTab.ownerDocument || !aTab.ownerDocument.defaultView.__SSi ||
> > !aWindow.getBrowser)
> > throw (Components.returnCode = Cr.NS_ERROR_INVALID_ARG);
>
>
> there is aWindow.getBrowser in duplicateTab function
> it should be aWindow.getBrowser() or aWindow.gBrowser
That code is simply checking to see if the function exists in the aWindow argument.
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•