cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [2/6] git commit: Stop the context menu from injecting multiple times.
Date Mon, 27 Jan 2014 16:04:17 GMT
Stop the context menu from injecting multiple times.

Otherwise this causes an infinite loop on KitKat, since loading more
scripts triggers onPageFinished to fire again, which triggers injection
of the context menu again, etc.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/1245da14
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/1245da14
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/1245da14

Branch: refs/heads/master
Commit: 1245da14cf1bbbd44e8334a5d026de6ff265a86e
Parents: 9f0189a
Author: Braden Shepherdson <braden.shepherdson@gmail.com>
Authored: Tue Jan 21 10:00:24 2014 -0500
Committer: Braden Shepherdson <braden.shepherdson@gmail.com>
Committed: Tue Jan 21 10:00:24 2014 -0500

----------------------------------------------------------------------
 www/cdvah/js/ContextMenuInjectScript.js | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/1245da14/www/cdvah/js/ContextMenuInjectScript.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/ContextMenuInjectScript.js b/www/cdvah/js/ContextMenuInjectScript.js
index d3c75ca..c245105 100644
--- a/www/cdvah/js/ContextMenuInjectScript.js
+++ b/www/cdvah/js/ContextMenuInjectScript.js
@@ -4,6 +4,7 @@
     /* global appIndexPlaceHolder */
     myApp.factory('ContextMenuInjectScript', [ function () {
         var toInject = function() {
+            if (window.__cordovaAppHarnessData) return; // Short-circuit if I've run on this
page before.
             console.log('Menu script injected.');
             var contextScript = document.createElement('script');
             contextScript.setAttribute('src', 'app-harness:///cdvahcm/ContextMenu.js');


Mime
View raw message