Links clicked in non-tab browsers should open in a tab.

RESOLVED FIXED in Firefox 55

Status

()

Toolkit
WebExtensions: Frontend
P2
normal
RESOLVED FIXED
2 years ago
9 months ago

People

(Reporter: wyohknott, Assigned: mixedpuppy)

Tracking

Trunk
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments)

(Reporter)

Description

2 years ago
Any external links contained inside an Options V2 options page should open in a new page. Currently it loads the external link in the frame containing the options.

(nb i'm using mozilla-central to test my extension versus bug #1250784 )
Assignee: nobody → kmaglione+bmo
Status: UNCONFIRMED → NEW
Component: WebExtensions → Add-ons Manager
Ever confirmed: true
Summary: options V2 API: external links should opened in new tab automatically → Links clicked in INLINE_OPTIONS_BROWSER should open in a new tab.

Updated

2 years ago
Priority: -- → P2
Whiteboard: triaged

Updated

a year ago
Assignee: kmaglione+bmo → mixedpuppy
(Assignee)

Comment 1

a year ago
Created attachment 8807812 [details]
Screen Shot 2016-11-04 at 7.09.32 PM.png

The fix for this is simple, the test for this is quite complex.

Adding "docShell.isAppTab = true;" to BrowserListener.init in ext-browser-content.js solves the issue.  Aside from the poor name "isAppTab", it essentially forces all non-same-origin links to external tabs.  If however we also want same-origin links to open in external tabs, we'll have to do something else.  

The attached image shows the inline options page with a link.  Do we allow same-origin navigation here, or force all links to external tabs?
(Assignee)

Comment 2

9 months ago
How the tab opens (new or replace) is based on prefs and how the user clicks on the link.  Also applies to any non-tab moz-ext browser.
Summary: Links clicked in INLINE_OPTIONS_BROWSER should open in a new tab. → Links clicked in non-tab browsers should open in a tab.
Comment hidden (mozreview-request)
Comment on attachment 8847760 [details]
Bug 1256289 force external links to open in tabs if non-tab browser,

https://reviewboard.mozilla.org/r/120684/#review123706

::: browser/base/content/webext-panels.js:48
(Diff revision 1)
>  
>    return readyPromise.then(() => {
>      browser.messageManager.loadFrameScript("chrome://browser/content/content.js", false);
> +    // Force external links to open in tabs.
> +    browser.messageManager.loadFrameScript(`data:,
> +      docShell.isAppTab = true;

Please just do this from the InitExtensionView listener, based on the view type:

http://searchfox.org/mozilla-central/rev/c9f5cc6b4593d461e87a6221dc0286b3859fd515/toolkit/components/extensions/ExtensionChild.jsm#1022
Attachment #8847760 - Flags: review?(kmaglione+bmo) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 7

9 months ago
Pushed by mixedpuppy@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9e6d16dd35a1
force external links to open in tabs if non-tab browser, r=kmag

Comment 8

9 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9e6d16dd35a1
Status: NEW → RESOLVED
Last Resolved: 9 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55

Updated

9 months ago
Component: Add-ons Manager → WebExtensions: Frontend
You need to log in before you can comment on or make changes to this bug.