Update libbrowz.js

This commit is contained in:
NodeMixaholic 2023-03-09 06:00:35 -06:00 committed by GitHub
parent 9b2f5f5b15
commit e6510bcdb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,9 @@ let tabGroup = document.querySelector("tab-group");
function go() { function go() {
let browserFrame = tabGroup.getActiveTab().webview let browserFrame = tabGroup.getActiveTab().webview
let browser = tabGroup.getActiveTab() let browser = tabGroup.getActiveTab()
browserFrame.loadURL(document.getElementById("txtUrl").value); let url = document.getElementById("txtUrl").value
document.getElementById("txtUrl").value = ""
browserFrame.loadURL(url);
browserFrame.addEventListener('dom-ready', () => { browserFrame.addEventListener('dom-ready', () => {
browserFrame.insertCSS(` browserFrame.insertCSS(`
::-webkit-scrollbar { ::-webkit-scrollbar {
@ -16,7 +18,6 @@ function go() {
tabGroup.getActiveTab().setTitle(title) tabGroup.getActiveTab().setTitle(title)
console.log(title) console.log(title)
}) })
document.getElementById("txtUrl").value = ""
for (let i = 0; i < userscripts.length; i++) { for (let i = 0; i < userscripts.length; i++) {
fetch(userscripts[i]).then( r => r.text() ).then( t => userscripts.executeJavaScript(t)).catch(() => { fetch(userscripts[i]).then( r => r.text() ).then( t => userscripts.executeJavaScript(t)).catch(() => {
console.log("Error loading userscripts! (Did you provide any?)") console.log("Error loading userscripts! (Did you provide any?)")
@ -51,4 +52,3 @@ function clickPress(keyEvent) {
go() go()
} }
} }