Closed Bug 345898 Opened 19 years ago Closed 17 years ago

Add error handling to getClosedTabCount

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3.1b2

People

(Reporter: zeniko, Assigned: zeniko)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file, 9 obsolete files)

... and at least undoCloseTab is missing a check for the existence of aWindow.__SSi as well.
Attached patch fix (obsolete) — Splinter Review
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: nobody → dietrich
Status: NEW → ASSIGNED
Attachment #239626 - Flags: review?(mano)
(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.
Attached patch fix + comment #2 suggestions (obsolete) — Splinter Review
(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)
Blocks: 352524
(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 on attachment 239693 [details] [diff] [review] fix + comment #2 suggestions Gah, forgot a file in the diff.
Attachment #239693 - Flags: review?(mano)
(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 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-
Attached patch fix v4 - addresses mano review (obsolete) — Splinter Review
(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?
Attachment #240962 - Flags: review? → review?(mano)
Attachment #240962 - Attachment is obsolete: true
Attachment #240962 - Flags: review?(mano)
Attached patch v5 - proper separator handling (obsolete) — Splinter Review
Attachment #240997 - Flags: review?(mano)
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
Attached patch using broadcater (obsolete) — Splinter Review
(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)
Attached patch using broadcaster v2 (obsolete) — Splinter Review
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
Component: General → Session Restore
QA Contact: general → session.restore
No longer blocks: 352524
Assignee: dietrich → nobody
Status: ASSIGNED → NEW
Attached patch updated patch (obsolete) — Splinter Review
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)
Attached patch patch and tests (obsolete) — Splinter Review
Assignee: nobody → zeniko
Attachment #334674 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #335580 - Flags: review?(dietrich)
Attachment #334674 - Flags: review?(dietrich)
Blocks: 426045
Attachment #335580 - Flags: review?(dietrich) → review+
Keywords: checkin-needed
This patch is bitrottted now. Need a new patch here.
Keywords: checkin-needed
Whiteboard: [needs new patch]
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
Keywords: checkin-needed
Whiteboard: [needs new patch]
Attachment #342742 - Attachment description: for check-in → for check-in [Checkin: Comment 19]
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.1b2
Version: unspecified → Trunk
> 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
(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.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: