[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 30 Nov 2022 13:36:39 -0500 (EST) |
branch: old/qt-info
commit f4326afb13359f9152449d4f231650c3adc66d8d
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Apr 12 15:22:27 2019 +0100
* js/info.js: Don't run init code or set event handlers if the
location is "about:blank". QWebEngine seems to add scripts even
into this page, which has bad results, e.g. with event handlers
running twice.
---
ChangeLog | 7 +++++++
js/info.js | 9 ++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e1d47b2bd7..c8af806f2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-04-11 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * js/info.js: Don't run init code or set event handlers if the
+ location is "about:blank". QWebEngine seems to add scripts even
+ into this page, which has bad results, e.g. with event handlers
+ running twice.
+
2019-04-11 Gavin Smith <gavinsmith0123@gmail.com>
* js/info.js: Remove section at end dealing with QWebChannel,
diff --git a/js/info.js b/js/info.js
index f645533f5e..41a46e10ca 100644
--- a/js/info.js
+++ b/js/info.js
@@ -1866,8 +1866,6 @@ var user_config = window["INFO_CONFIG"];
var span = document.createElement ("span");
span.innerHTML = "?";
span.classList.add ("icon");
- span.setAttribute ("style", "color: darkgrey;font-size: x-large;");
- // todo: need .icon:hover and .icon:focus as well - see info.css
span.addEventListener ("click", function () {
store.dispatch (actions.show_help ());
}, false);
@@ -2008,8 +2006,13 @@ var user_config = window["INFO_CONFIG"];
};
}
+var inside_top_page;
+
/* Wrap init code */
function init() {
+ if (location == "about:blank")
+ return;
+
/* Check if current browser supports the minimum requirements required for
properly using this script, otherwise bails out. */
if (features && !(features.es5
@@ -2038,7 +2041,7 @@ function init() {
config = Object.assign (config, user_config);
var inside_iframe = top !== window;
- var inside_top_page = window.location.pathname === config.TOP_NAME
+ inside_top_page = window.location.pathname === config.TOP_NAME
|| window.location.pathname.endsWith ("/" + config.TOP_NAME)
|| window.location.pathname.endsWith ("/");
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30