qutebrowser: Fix bare redirect exception
This commit is contained in:
parent
a16e0eead7
commit
337b250aba
1 changed files with 6 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
import random
|
||||
import re
|
||||
from qutebrowser.api import interceptor
|
||||
from qutebrowser.extensions.interceptors import RedirectException
|
||||
|
||||
redirects = {
|
||||
"youtube": {
|
||||
|
@ -184,6 +185,7 @@ redirects = {
|
|||
},
|
||||
}
|
||||
|
||||
|
||||
def rewrite(request: interceptor.Request):
|
||||
if (
|
||||
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:
|
||||
try:
|
||||
request.redirect(url)
|
||||
except:
|
||||
except RedirectException:
|
||||
pass
|
||||
break
|
||||
|
||||
|
|
Loading…
Reference in a new issue