From f47b1211d286e1ea5b050a3df459aa4e9d711789 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 22 Mar 2014 20:06:45 +0000 Subject: [PATCH] canvas render plugin: add setting to window object outside of wrapper - this makes it work on mobile despite order potentially being wrong note: also unsafeWindow version attempted, for tampermonkey/greasemonkey - but this doesn't work for some reason --- plugins/canvas-render.user.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/canvas-render.user.js b/plugins/canvas-render.user.js index 63bf9e1d..9a1f6d69 100644 --- a/plugins/canvas-render.user.js +++ b/plugins/canvas-render.user.js @@ -11,15 +11,21 @@ // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* // @match http://www.ingress.com/intel* -// @grant none +// @grant unsafeWindow // ==/UserScript== +// NON-STANDARD plugin - try and set the variable early, as +// we need this global variable set before leaflet initialises +window.L_PREFER_CANVAS = true; +if (typeof unsafeWindow !== 'undefined') unsafeWindow.L_PREFER_CANVAS = true; //doesn't actually work... :/ + + @@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// // we need this global variable set before leaflet initialises -L_PREFER_CANVAS = true; +window.L_PREFER_CANVAS = true; // use own namespace for plugin window.plugin.canvasRendering = function() {};