Closed Bug 937569 Opened 11 years ago Closed 11 years ago

Peek tab doesn't work for links with new targets

Categories

(Firefox for Metro Graveyard :: Browser, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 28

People

(Reporter: jimm, Assigned: jimm)

Details

Attachments

(2 files)

Attached file linktarget.html
See the test case. Links with new targets get injected into new tabs without the user's knowledge. Not sure if this is by design or if it's a bug, I think we should be doing a tab peek here?
Attached patch patchSplinter Review
Seems like this nsBrowserAccess thing should be over with BrowserUI, but I'm not sure about the history here.  

- I cleaned up the code a bit, and removed some stuff related to apps.
- I'm concerned about removing that call to BrowserUI.showContent() but it doesn't seem to break anything. It was calling ContextUI.dismissTabs so I had to remove it.
Assignee: nobody → jmathies
Attachment #830812 - Flags: review?(mbrubeck)
Comment on attachment 830812 [details] [diff] [review]
patch

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

::: browser/metro/base/content/browser-ui.js
@@ +440,5 @@
>      return Browser.addTab(aURI || kStartURI, true, aOwner);
>    },
>  
> +  peekTabs: function () {
> +    ContextUI.peekTabs(kNewTabAnimationDelayMsec);

ContextUI.peekTabs already uses kNewTabAnimationDelayMsec if you don't pass in a value, so I don't feel the need to add this alias.

Also, for this use case it should be kOpenInNewTabAnimationDelayMsec.

::: browser/metro/base/content/browser.js
@@ +1100,5 @@
>    openURI: function browser_openURI(aURI, aOpener, aWhere, aContext) {
> +    let where = this._getOpenAction(aURI, aOpener, aWhere, aContext);
> +    // Link clicks in content need to trigger peek tab functionality
> +    if (where == Ci.nsIBrowserDOMWindow.OPEN_NEWTAB) {
> +      BrowserUI.peekTabs();

I'd like to put the peekTabs call next to the addTab call, in _getBrowser.

I'll be refactoring this a bit in bug 888353, but I'm happy to rebase on top of this if you land first.  After bug 888353 lands, this code can call BrowserUI.openLinkInNewTab which will call both addTab and peekTabs.
Attachment #830812 - Flags: review?(mbrubeck) → review+
https://hg.mozilla.org/mozilla-central/rev/0c50caf7ab6a
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
Whiteboard: [triage]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: