[✔️] Follow ts-standard
This commit is contained in:
parent
075bd7d791
commit
208544d7e1
1 changed files with 6 additions and 8 deletions
|
|
@ -82,9 +82,9 @@ export default class BrowserApp implements App {
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle (): void {
|
||||||
this.proxy = !this.proxy
|
this.proxy = !this.proxy
|
||||||
if (this.proxy === false) {
|
if (!this.proxy) {
|
||||||
if (this === tabManager.activeTab) {
|
if (this === tabManager.activeTab) {
|
||||||
win.content.querySelector('.toggle')?.classList.remove('bx-wifi')
|
win.content.querySelector('.toggle')?.classList.remove('bx-wifi')
|
||||||
win.content.querySelector('.toggle')?.classList.add('bx-wifi-off')
|
win.content.querySelector('.toggle')?.classList.add('bx-wifi-off')
|
||||||
|
|
@ -143,9 +143,7 @@ export default class BrowserApp implements App {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!tab.proxy) {
|
||||||
|
|
||||||
if (tab.proxy === false) {
|
|
||||||
try { (win.content.querySelector('.inp') as HTMLInputElement).value = (tab.iframe.contentWindow as Window).location.href } catch (e) { (win.content.querySelector('.inp') as HTMLInputElement).value = 'about:blank' }
|
try { (win.content.querySelector('.inp') as HTMLInputElement).value = (tab.iframe.contentWindow as Window).location.href } catch (e) { (win.content.querySelector('.inp') as HTMLInputElement).value = 'about:blank' }
|
||||||
win.content.querySelector('.toggle')?.classList.remove('bx-wifi')
|
win.content.querySelector('.toggle')?.classList.remove('bx-wifi')
|
||||||
win.content.querySelector('.toggle')?.classList.add('bx-wifi-off')
|
win.content.querySelector('.toggle')?.classList.add('bx-wifi-off')
|
||||||
|
|
@ -168,10 +166,10 @@ export default class BrowserApp implements App {
|
||||||
|
|
||||||
win.content.querySelector('.inp')?.addEventListener('keydown', (event: KeyboardEvent) => {
|
win.content.querySelector('.inp')?.addEventListener('keydown', (event: KeyboardEvent) => {
|
||||||
if (event.key === 'Enter') {
|
if (event.key === 'Enter') {
|
||||||
if (tabManager.activeTab.proxy === true) {
|
if (tabManager.activeTab.proxy) {
|
||||||
tabManager.activeTab.iframe.src = `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value)}`
|
tabManager.activeTab.iframe.src = `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value)}`
|
||||||
} else {
|
} else {
|
||||||
tabManager.activeTab.iframe.src = (win.content.querySelector('.inp') as HTMLInputElement).value as string
|
tabManager.activeTab.iframe.src = (win.content.querySelector('.inp') as HTMLInputElement).value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -238,7 +236,7 @@ export default class BrowserApp implements App {
|
||||||
tabManager.activeTab.toggle()
|
tabManager.activeTab.toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
tabManager.addTab(new Tab(`https://google.com`))
|
tabManager.addTab(new Tab('https://google.com'))
|
||||||
|
|
||||||
return win
|
return win
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue