Closed Bug 662004 Opened 9 years ago Closed 9 years ago

Extensions preferences in a tab

Categories

(Toolkit :: Add-ons Manager, enhancement)

enhancement
Not set

Tracking

()

VERIFIED FIXED
mozilla7

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

Allow extensions to open their optionsURL in a tab instead of a new window.
Attached patch patch (obsolete) — Splinter Review
Attachment #537299 - Flags: review?(dtownsend)
Comment on attachment 537299 [details] [diff] [review]
patch

Review of attachment 537299 [details] [diff] [review]:
-----------------------------------------------------------------

If there is any way we can avoid relying on switchToTabHavingURI then I'd like to do that, going to think on it a little to see if I can come up with anything while you make the small changes here.

::: toolkit/mozapps/extensions/content/extensions.js
@@ +940,5 @@
>          }
>          var optionsURL = aAddon.optionsURL;
> +        if (aAddon.optionsType == AddonManager.OPTIONS_TYPE_TAB) {
> +          var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
> +                           .getInterface(Ci.nsIWebNavigation)

Indent these to line up with the . in the line above

@@ +948,5 @@
> +          if ("switchToTabHavingURI" in mainWindow) {
> +            mainWindow.switchToTabHavingURI(optionsURL, true);
> +            return;
> +          }
> +        }

Kind of dislike having to rely on a function in the main window. Let's at least define this as a standalone function that it'd be easy for a given application to override with its own logic.
Attachment #537299 - Flags: review?(dtownsend) → review-
Attached patch patchSplinter Review
Attachment #537299 - Attachment is obsolete: true
Attachment #538627 - Flags: review?(dtownsend)
Comment on attachment 538627 [details] [diff] [review]
patch

Review of attachment 538627 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #538627 - Flags: review?(dtownsend) → review+
Status: NEW → ASSIGNED
Merged:
http://hg.mozilla.org/mozilla-central/rev/b1d2e03ba809
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla7
Version: unspecified → Trunk
Verified fixed with Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0a1) Gecko/20110703 Firefox/7.0a1

Geoff, could you please add the URL to the developer documentation to this bug? Thanks.
Status: RESOLVED → VERIFIED
Flags: in-testsuite?
Flags: in-testsuite+
Flags: in-litmus-
Duplicate of this bug: 1041170
You need to log in before you can comment on or make changes to this bug.