From d32444803942022fddfdb07ac85648461f76e64d Mon Sep 17 00:00:00 2001 From: cauimsouza Date: Tue, 4 Sep 2018 16:40:05 +0200 Subject: [PATCH] Fix mute_per_domain feature Users can allow sounds to be played by default while specifying domains not allowed to play sounds, or the opposite. --- qutebrowser/browser/webengine/webenginetab.py | 6 +++--- qutebrowser/config/configdata.yml | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 5a3042ba9..33f91850a 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -653,9 +653,9 @@ class WebEngineAudio(browsertab.AbstractAudio): return page.recentlyAudible() def _on_url_changed(self): - urlstr = self._tab.url().toString(QUrl.RemoveUserInfo) - muted_url = config.instance.get('content.mute', url=urlstr) - self.set_muted(muted_url is not None) + url = self._tab.url() + is_audible = config.instance.get('content.audible_default', url=url) + self.set_muted(not is_audible) class _WebEnginePermissions(QObject): diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index bde38cbb8..73af245c0 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -746,13 +746,11 @@ content.xss_auditing: Suspicious scripts will be blocked and reported in the inspector's JavaScript console. -content.mute: - default: null - type: - name: String - none_ok: true +content.audible_default: + default: true + type: Bool + desc: Play sounds automatically in web pages. supports_pattern: true - desc: List of URLs muted by default. # emacs: '