Commit e10e5e18 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Readd code, not related to previous bug fix

parent 16ca23a2
Pipeline #58311 passed with stage
in 8 minutes and 2 seconds
......@@ -106,6 +106,18 @@ class WebViewNavigation:
self.__update_bookmark_metadata(self.uri)
elif event == WebKit2.LoadEvent.REDIRECTED:
self.__update_bookmark_metadata(self.uri)
# Block ads, useful for some site
if App().settings.get_value("adblock") and\
parsed.scheme in ["http", "https"] and\
not App().adblock_exceptions.find_parsed(parsed):
if App().adblock.is_netloc_blocked(parsed.netloc) or\
App().adblock.is_uri_blocked(self.uri,
parsed.netloc):
Logger.debug("WebView::__wait_for_uri(): blocking %s",
self.uri)
webview.stop_loading()
self._window.container.close_view(self.view)
return
elif event == WebKit2.LoadEvent.COMMITTED:
self.emit("uri-changed", self.uri)
App().history.set_page_state(self.uri)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment