This commit is contained in:
Jason 2022-02-24 14:50:48 -05:00
commit d4b88cc777
2 changed files with 3 additions and 3 deletions

View file

@ -1 +1 @@
# ultraviolet-frontend
# Ultraviolet Frontend

View file

@ -4,7 +4,7 @@ const input = document.querySelector('input');
form.addEventListener('submit', async event => {
event.preventDefault();
window.navigator.serviceWorker.register(__uv$config.sw, {
scope: '/'
scope: __uv$config.prefix
}).then(() => {
let url = input.value.trim();
if (!isUrl(url)) url = 'https://www.google.com/search?q=' + url;
@ -18,4 +18,4 @@ form.addEventListener('submit', async event => {
function isUrl(val = ''){
if (/^http(s?):\/\//.test(val) || val.includes('.') && val.substr(0, 1) !== ' ') return true;
return false;
};
};