<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27653</bug_id>
          
          <creation_ts>2014-12-18 06:25:42 +0000</creation_ts>
          <short_desc>Navigation scope</short_desc>
          <delta_ts>2015-09-02 08:46:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NEEDSINFO</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcos Caceres">w3c</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116460</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2014-12-18 06:25:42 +0000</bug_when>
    <thetext>The &apos;Web Manifest&apos; spec wants to define a &quot;navigation scope&quot; that restricts the set of URLs that an application can be navigated to [1]. This works as a kind of fence that says:

&quot;The scope of this app is anything in http://example.com/foo&quot;. 

Meaning that the following are &quot;in scope&quot; for navigation:

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

And the following are &quot;out of scope&quot;:

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&apos;s navigate algorithm accepted a URL to scope navigation to. Although it&apos;s possible to check if a URL is in scope prior to navigation, it&apos;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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116648</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-12-22 23:55:56 +0000</bug_when>
    <thetext>This seems very related to Service Workers&apos; concept of what is in scope for a worker. Is there any effort to align these features?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116649</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-12-22 23:57:16 +0000</bug_when>
    <thetext>See bug 27146.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116706</commentid>
    <comment_count>3</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2014-12-30 07:55:18 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #1)
&gt; This seems very related to Service Workers&apos; concept of what is in scope for
&gt; 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&apos;t relate to navigation of a browsing context.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116851</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-01-06 22:44:34 +0000</bug_when>
    <thetext>Service workers relate to navigation: they control where the data comes from for the navigation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116943</commentid>
    <comment_count>5</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2015-01-09 05:42:54 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #4)
&gt; Service workers relate to navigation: they control where the data comes from
&gt; for the navigation.

Ok, I see. I&apos;ll track what comes out of bug 27146 and see if we can align somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123016</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-09-02 08:46:21 +0000</bug_when>
    <thetext>I&apos;m going to close this as it&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>