Compare commits
2 commits
304c0737f4
...
5b75a64e84
Author | SHA1 | Date | |
---|---|---|---|
Izalia Mae | 5b75a64e84 | ||
Izalia Mae | 5f615c6e9a |
|
@ -2,7 +2,7 @@ import cairo
|
|||
import threading
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from dns.resolver import NXDOMAIN
|
||||
from dns.resolver import NXDOMAIN, NoAnswer
|
||||
from izzylib.exceptions import DNSResolverError
|
||||
from izzylib.misc import class_name
|
||||
from izzylib.url import Address
|
||||
|
@ -519,7 +519,7 @@ class WebTab(BuilderBase, Gtk.Box):
|
|||
url = Url(f'{proto}://{full_url}')
|
||||
|
||||
except ValueError:
|
||||
return self.window.notification(f'Not a valid url: {full_url}')
|
||||
return run_in_gui_thread(self.window.notification, f'Not a valid url: {full_url}')
|
||||
|
||||
else:
|
||||
url = Url(full_url)
|
||||
|
@ -555,8 +555,8 @@ class WebTab(BuilderBase, Gtk.Box):
|
|||
port = 80 if url.port == 443 else url.port
|
||||
)
|
||||
|
||||
except NXDOMAIN:
|
||||
pass
|
||||
except (NXDOMAIN, NoAnswer):
|
||||
return run_in_gui_thread(self.window.notification, f'Failed to resolve domain: {url.domain}')
|
||||
|
||||
if not address:
|
||||
search = s.get_search(keyword, default=True)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import json, sys, threading, time
|
||||
|
||||
from izzylib.misc import Boolean
|
||||
from izzylib_sql import Row
|
||||
|
||||
from .status_bar import StatusBar
|
||||
|
@ -423,9 +424,19 @@ class Window(BuilderBase, Gtk.ApplicationWindow):
|
|||
|
||||
|
||||
def handle_page_switch(self, notebook, tab, pagenum):
|
||||
with self.app.db.session as s:
|
||||
if tab._data.state and not self.startup and s.get_config('load_switch'):
|
||||
tab.page_action('refresh')
|
||||
if load_switch_cache := self.db.cache['config'].get('load_switch'):
|
||||
load_switch = Boolean(load_switch_cache['value'])
|
||||
|
||||
else:
|
||||
with self.db.session() as s:
|
||||
load_switch = s.get_config('load_switch')
|
||||
|
||||
if load_switch and tab._data.state and not self.startup:
|
||||
tab.page_action('refresh')
|
||||
|
||||
# with self.app.db.session as s:
|
||||
# if tab._data.state and not self.startup and s.get_config('load_switch'):
|
||||
# tab.page_action('refresh')
|
||||
|
||||
if tab.id in self.taborder:
|
||||
self.taborder.remove(tab.id)
|
||||
|
|
Reference in a new issue