Browse Source

Gui: Manually fire javascript event and exit [#836]

gnosygnu 4 years ago
parent
commit
e117823e60
1 changed files with 7 additions and 1 deletions
  1. 7 1
      150_gfui/src/gplx/gfui/kits/swts/Swt_html.java

+ 7 - 1
150_gfui/src/gplx/gfui/kits/swts/Swt_html.java

@@ -1,6 +1,6 @@
 /*
 XOWA: the XOWA Offline Wiki Application
-Copyright (C) 2012-2020 gnosygnu@gmail.com
+Copyright (C) 2012-2021 gnosygnu@gmail.com
 
 XOWA is licensed under the terms of the General Public License (GPL) Version 3,
 or alternatively under the terms of the Apache License Version 2.0.
@@ -272,6 +272,12 @@ class Swt_html_lnr_location implements LocationListener {
 			return;
 		}
 
+		if (String_.Has_at_bgn(location, "javascript:")) {
+			html_box.Html_js_eval_script(location);
+			arg.doit = false;
+			return;
+		}
+
 		try {
 			Gfo_evt_mgr_.Pub_obj(host, evt, "v", location);
 			arg.doit = false; // cancel navigation event, else there will be an error when trying to go to invalid location