MY directories are as follows.
public_html/
sw/
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/".
JS
<script>
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);
});
};
</script>
How do I allow this sort of scope?