Authors: XU Zhengyi
This document is a starting point for engaging the community and standards bodies in developing collaborative solutions fit for standardization. As the solutions to problems described in this document progress along the standards-track, we will retain this document as an archive and use this section to keep the community up-to-date with the most current standards venue and content location of future work and discussions.
- This document status: Active
- Expected venue: W3C Web Incubator Community Group
- Current version: this document
Split screen scenarios are becoming more and more prevalent in today's world. In addition to dual screen devices (ie. physical split screen), browsers such as Edge, Whale and Arc ship split tab (ie. virtual split screen) features. When using virtual split screen in a browser, there are multiple cases in which users want to open links and view them side-by-side with the source page (see the Use Cases section for examples). Currently, there is no option for web authors to target a link to open directly into a split tab. The current navigation targets, such as _blank
, _self
, _parent
, _top
, are insufficient to solve this problem.
This explainer proposes a solution to allow web authors to open links into a split tab.
- Provide an API that allows websites to target navigations at a split tab.
- Provide an API that also handles physical split screen targets. That said, the current proposal should be easily extendable to support dual screen scenarios in the future.
The feature is intended to be used by any website that wants to open a link into a split tab. Here are some scenarios in which this can be useful to users:
- On a search engine results page (SERP), the user can open links and explore results in a split tab without navigating away from the SERP.
- On a video site, the user can watch a video in a split tab while still being able to preview other results in the source page.
- On a news feed site, the user can open a news article in a split tab and continue to browse the news feed.
- On a social media site, the user can open a link in a split tab and continue to browse the feed.
- On a shopping site, the user can open a product page in a split tab and continue to browse the product list.
- On an office automation (OA) system or email site, the user can preview external document links in split tab.
This proposal supports opening links in a split tab by:
-
Adding a new value called
_split
to thetarget
attribute on the anchor element and thetarget
parameter of the window.open API. (The name_split
is not final; suggestions are welcome!)-
On supported browsers:
- Browsers should apply
noopener
-like behavior for links opened with target_split
. In other words,window.opener
for links opened in a split tab should benull
. - When
navigator.splitTabSupported
returnsfalse
,_split
should fallback to behaving like target_blank
. UAs may apply their own criteria (ex. screen size, user settings) to decide whether split tab is available or not.
- Browsers should apply
-
Examples:
- HTML Anchor element
<a target="_split" href="https://www.example.com">Open in split tab</a>
- window.open API
// Open url in split tab. window.open("https://www.example.com", "_split");
- HTML Anchor element
-
Update the 7.3.1.7 Navigable target names spec as follows:
Keyword Ordinary effect Effect in an iframe
with...sandbox=""
sandbox="allow-top-navigation"
_split
split tab or new split tab or maybe new split tab or maybe new -
Update The rules for choosing a navigable spec as follows:
- ...
- Otherwise, if name is not an ASCII case-insensitive match for "
_blank
" or "_split
"...
- ...
- If the user agent has been configured such that in this instance it will create a new top-level traversable
- ...
- ...
- Set noopener to true.
- If name is not an ASCII case-insensitive match for "
_split
", set name to "_blank
". - Set windowType to "
new with no opener
".
- If name is an ASCII case-insensitive match for "
_split
", then:- Set noopener to true.
- If the user agent doesn't support the split tab feature, then set name to "
_blank
". - If the user agent support the split tab feature, set windowType to "
split tab with no opener
".
- ...
- ...
- If name is not an ASCII case-insensitive match for "
_blank
" or "_split
", then set targetName to name.
- ...
-
-
Adding a
splitTabSupported
property to theNavigator
object.navigator.splitTabSupported
returns a Boolean value indicating whether the browser supports a virtual split screen configuration or not.- Example:
if (navigator.splitTabSupported) { // The browser does support split tab feature. }
- Example:
- This proposal is a natural extension of the
target
attribute on anchor elements and thetarget
parameter onwindow.open
, therefore should be easy for web developers to understand.
navigator.splitTabSupported
could only be accessed by JS, this means the authors of the website have to set the target via JS and not via HTML. One possible mitigation is setting a cookie when user first opened the website and then the server could know the client support this feature and could set it via HTML on next visit.- On unsupported browsers, if a website uses
_split
without settingnoopener
, an opener will be set.- This can be mitigated if web authors always set
noopener
when using_split
. A note could be added to the spec for this. - Web authors could also check for
navigator.splitTabSupported
before setting the target.
- This can be mitigated if web authors always set
- On unsupported browsers, if we already opened a frame named
_split
, the navigation will be done in that frame.- It is valid for a
target
value to be the name of a sub-frame (See the reference here). Any existing sites that have a frame named_split
would expect that frame to be navigated when a link with that target is clicked. Even though the spec mentions that names starting with an underscore are reserved for special keywords, if a site is using_split
in this way, it would be broken once_split
is used for split tab navigations. Implementors can add a use counter to identify whether such sites exists, and if they do, a different name instead of_split
could be used.
- It is valid for a
navigator.splitTabSupported
exposes the information that user's browser supports split screen.
- As mentioned in the Cons section, web authors should set noopener with
_split
.
To avoid issues with fallback on unsupported browsers, an alternative solution is adding a new attribute like split-tab
to the anchor element and params
of window.open()
. The split-tab
attribute will have no effect on unsupported browsers.
- No side effects on unsupported browsers.
- Not as idiomatic as adding a new value to the
target
attribute. - If a web author specifies both
target
andsplit-tab
, it is unclear which should take priority and may be tricky to specify.
- Should web authors be able to customize the fallback behavior of
_split
? It is unclear if fallback to_blank
is always desirable. - Should the
_split
target behave differently inside sandboxed iframes? If so, should we add a new value to thesandbox
attribute to allow this, ex.allow-split-tab-navigation
?