How to register a service worker's scope one directory above where the service_worker.js is located : <p>MY directories are as follows.</p>

<pre><code>public_html/
sw/
</code></pre>

<p>The "sw/" is where I want to put all service workers, but then have those service workers with a scope to all the files in "public_html/". </p>

<p><strong>JS</strong></p>

<pre><code>&lt;script&gt;
if ('serviceWorker' in navigator) {
  navigator.serviceWorker.register('sw/notifications.js', { scope: '../sw/' }).then(function(reg) {
    // registration worked
    console.log('Registration succeeded. Scope is ' + reg.scope);
  }).catch(function(error) {
    // registration failed
    console.log('Registration failed with ' + error);
  });
};
&lt;/script&gt;
</code></pre>

<p>How do I allow this sort of scope?</p>
