Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fowntain committed Nov 27, 2024
2 parents 089362a + b50c7fd commit b98ffda
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"@cypress/request": "^3.0.0",
"@mercuryworkshop/bare-mux": "^2.1.7",
"@mercuryworkshop/bare-mux": "^2.0.4",
"@mercuryworkshop/libcurl-transport": "1.3.10",
"@mercuryworkshop/epoxy-transport": "^2.1.26",
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
"@titaniumnetwork-dev/ultraviolet": "3.2.7",
"@tomphttp/bare-server-node": "2.0.3",
"chalk": "^5.3.0",
"express": "^4.18.2",
Expand Down
51 changes: 24 additions & 27 deletions static/assets/js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,30 @@ function createDomainRegex(domains) {
}

searchBar.addEventListener("keydown", function(event) {
if (event.key === 'Enter') {
var inputUrl = searchBar.value.trim();
searchBar.blur();
fetchDomains().then(domains => {
const domainRegex = createDomainRegex(domains);
const searchValue = searchBar.value.trim();
if (vercelCheck !== 'true') {
if (domainRegex.test(searchValue)) {
scope = '/assignments/';
} else {
scope = '/service/';
}
} else {
scope = '/assignments/';
// serverless = no websocket support
}

if (/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/.test(inputUrl)) {
// inputUrl = inputUrl.replace(/^https:\/\//, 'http://');
} else {
document.getElementById('siteurl').src = scope + Ultraviolet.codec.xor.encode(inputUrl.includes('.') ? 'http://' + inputUrl : 'http://www.google.com/search?q=' + encodeURIComponent(inputUrl));
}
});
}
if (event.key === 'Enter') {
var inputUrl = searchBar.value.trim();
searchBar.blur();
fetchDomains().then(domains => {
const domainRegex = createDomainRegex(domains);
const searchValue = searchBar.value.trim();
if (vercelCheck !== 'true') {
if (domainRegex.test(searchValue)) {
scope = '/assignments/';
} else {
scope = '/service/';
}
} else {
scope = '/assignments/';
// serverless = no websocket support
}
if (/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/.test(inputUrl)) {
document.getElementById('siteurl').src = scope + Ultraviolet.codec.xor.encode(inputUrl);
} else {
document.getElementById('siteurl').src = scope + Ultraviolet.codec.xor.encode(inputUrl.includes('.') ? 'https://' + inputUrl : 'https://www.google.com/search?q=' + encodeURIComponent(inputUrl));
}
});
}
});


setTimeout(function() {
var searchBarValue = document.getElementById('searchBar').value;
if (searchBarValue.startsWith('https://')) {
Expand Down Expand Up @@ -325,4 +322,4 @@ frame.addEventListener('load', interceptFrame);
document.addEventListener('DOMContentLoaded', function() {
onFrameClick();
setInterval(onFrameClick, 1000);
});
});
3 changes: 2 additions & 1 deletion static/data/b-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"1v1.lol",
"krunker.io",
"rocketbotroyale.winterpixel.io",
"html5.gamedistribution.com"
"html5.gamedistribution.com",
"play.geforcenow.com"
]
}

0 comments on commit b98ffda

Please sign in to comment.