summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-11-29 14:53:59 +0100
committerFlorian Bruhin <me@the-compiler.org>2020-11-29 14:53:59 +0100
commitb506885eb1e4ad5f5b54a2863f175d168855d390 (patch)
tree44d46d97e61f9424e6dff0a6cf2966d878e7630a
parent6a9f3d6cf55d7863b9b650aece2ab081e46bfc61 (diff)
downloadqutebrowser-b506885eb1e4ad5f5b54a2863f175d168855d390.tar.gz
qutebrowser-b506885eb1e4ad5f5b54a2863f175d168855d390.zip
Fix HTML-escaping of JavaScript messages
With f8309d995641a7eb6113c8b0bc4bbb1faa7e8a86, the conditional escaping for Qt <= 5.11 was dropped. However, while doing so, I accidentally thought that bug was about Qt *not* escaping messages in older versions, while in reality it was the other way around... Thus, we now have to unconditionally escape them, rather than not escaping them at all.
-rw-r--r--qutebrowser/browser/shared.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py
index 193a2a0e0..9234e82d8 100644
--- a/qutebrowser/browser/shared.py
+++ b/qutebrowser/browser/shared.py
@@ -82,7 +82,7 @@ def javascript_confirm(url, js_msg, abort_on):
raise CallSuper
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()),
- js_msg)
+ html.escape(js_msg))
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
ans = message.ask('Javascript confirm', msg,
mode=usertypes.PromptMode.yesno,
@@ -99,7 +99,7 @@ def javascript_prompt(url, js_msg, default, abort_on):
return (False, "")
msg = '<b>{}</b> asks:<br/>{}'.format(html.escape(url.toDisplayString()),
- js_msg)
+ html.escape(js_msg))
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
answer = message.ask('Javascript prompt', msg,
mode=usertypes.PromptMode.text,
@@ -122,7 +122,7 @@ def javascript_alert(url, js_msg, abort_on):
return
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()),
- js_msg)
+ html.escape(js_msg))
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
message.ask('Javascript alert', msg, mode=usertypes.PromptMode.alert,
abort_on=abort_on, url=urlstr)