Merge branch 'main' of https://github.com/titaniumnetwork-dev/ultraviolet-frontend
This commit is contained in:
commit
d4b88cc777
2 changed files with 3 additions and 3 deletions
|
|
@ -1 +1 @@
|
|||
# ultraviolet-frontend
|
||||
# Ultraviolet Frontend
|
||||
|
|
|
|||
4
index.js
4
index.js
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue