qutebrowser: Fix bare redirect exception

This commit is contained in:
Marty Oehme 2023-03-22 11:48:57 +01:00
parent a16e0eead7
commit 337b250aba
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -1,6 +1,7 @@
import random import random
import re import re
from qutebrowser.api import interceptor from qutebrowser.api import interceptor
from qutebrowser.extensions.interceptors import RedirectException
redirects = { redirects = {
"youtube": { "youtube": {
@ -184,6 +185,7 @@ redirects = {
}, },
} }
def rewrite(request: interceptor.Request): def rewrite(request: interceptor.Request):
if ( if (
request.resource_type != interceptor.ResourceType.main_frame request.resource_type != interceptor.ResourceType.main_frame
@ -204,7 +206,7 @@ def rewrite(request: interceptor.Request):
if target is not None and url.setHost(target) is not False: if target is not None and url.setHost(target) is not False:
try: try:
request.redirect(url) request.redirect(url)
except: except RedirectException:
pass pass
break break