This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27653 - Navigation scope
Summary: Navigation scope
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-18 06:25 UTC by Marcos Caceres
Modified: 2015-09-02 08:46 UTC (History)
4 users (show)

See Also:


Attachments

Description Marcos Caceres 2014-12-18 06:25:42 UTC
The 'Web Manifest' spec wants to define a "navigation scope" that restricts the set of URLs that an application can be navigated to [1]. This works as a kind of fence that says:

"The scope of this app is anything in http://example.com/foo". 

Meaning that the following are "in scope" for navigation:

http://example.com/foo
http://example.com/foo#bar
http://example.com/foo/bar/

And the following are "out of scope":

http://example.com/
http://example.com/bar#foo
http://example.com/whatever

The intent is to prevent a web application from being navigated to somewhere unexpected (e.g., by an advertisement).  

It would be nice if HTML's navigate algorithm accepted a URL to scope navigation to. Although it's possible to check if a URL is in scope prior to navigation, it's not possible for the Web manifest spec to do this during a redirect (without monkey-patching the HTML spec). 

Few more details: A web application only has one navigation scope. If the navigation scope is undefined in the web manifest, the user agent just runs HTML's navigate algorithm as normal.

I expect that if a navigation is out of scope, then a security error would be  returned.

[1] https://github.com/w3c/manifest/issues/114
Comment 1 Ian 'Hixie' Hickson 2014-12-22 23:55:56 UTC
This seems very related to Service Workers' concept of what is in scope for a worker. Is there any effort to align these features?
Comment 2 Ian 'Hixie' Hickson 2014-12-22 23:57:16 UTC
See bug 27146.
Comment 3 Marcos Caceres 2014-12-30 07:55:18 UTC
(In reply to Ian 'Hixie' Hickson from comment #1)
> This seems very related to Service Workers' concept of what is in scope for
> a worker. Is there any effort to align these features?

Yes, the way one determines if something is in scope of something else is the same. However, IIUC, I service workers don't relate to navigation of a browsing context.
Comment 4 Ian 'Hixie' Hickson 2015-01-06 22:44:34 UTC
Service workers relate to navigation: they control where the data comes from for the navigation.
Comment 5 Marcos Caceres 2015-01-09 05:42:54 UTC
(In reply to Ian 'Hixie' Hickson from comment #4)
> Service workers relate to navigation: they control where the data comes from
> for the navigation.

Ok, I see. I'll track what comes out of bug 27146 and see if we can align somehow.
Comment 6 Anne 2015-09-02 08:46:21 UTC
I'm going to close this as it's not actionable. My recommendation would be to write a monkey patch for the navigate algorithm and then file an issue or PR to see how and if we can integrate this.