From 5b3f0f003e0f7f30e1f0d72e2ea977a84ed23437 Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <ericrasmussen1@gmail.com>
Date: Wed, 16 Jan 2019 09:48:49 -0600
Subject: [PATCH] Fix Chrome iOS embed iframe issue

---
 www/index.php    | 2 +-
 www/js/search.js | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/www/index.php b/www/index.php
index ae4eb03..eb6ee0b 100644
--- a/www/index.php
+++ b/www/index.php
@@ -26,7 +26,7 @@ function loadDefaultSections($page)
     $page->affiliation = '';
 }
 
-$localScriptUrl = './js/search.min.js?v=4.1.20';
+$localScriptUrl = './js/search.min.js?v=20190116';
 
 if (UNL_Search::$mode === 'debug') {
     $pageTemplate = 'Local';
diff --git a/www/js/search.js b/www/js/search.js
index 4a57e73..070164f 100644
--- a/www/js/search.js
+++ b/www/js/search.js
@@ -381,6 +381,14 @@ define(['jquery', 'analytics'], function ($, analytics) {
 						return;
 					}
 
+					// Chrome iOS issues a message on touch that is an object with
+					// oEvent.data.type = 'org.chromium.contextMenuMessage'.
+					// We will just ignore anything that isn't a string, which is what is
+					// expected from the parent window with wdntemplates's embedded search.
+					if (typeof oEvent.data !== 'string') {
+						return;
+					}
+
 					q = $.trim(oEvent.data);
 					passiveQuery(q);
 				});
-- 
GitLab