From d1e776379112c18164d83f1e94add038911499a2 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Wed, 7 Nov 2018 22:12:18 -0600 Subject: [PATCH] userscript/staging-move-drag-n-drop: move browser compatability check to init. --- userscript/staging-move-drag-n-drop.user.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/userscript/staging-move-drag-n-drop.user.js b/userscript/staging-move-drag-n-drop.user.js index 87295e9d..5caf5686 100644 --- a/userscript/staging-move-drag-n-drop.user.js +++ b/userscript/staging-move-drag-n-drop.user.js @@ -16,6 +16,11 @@ (function() { + // Exclude not usable browsers. + if (!document.querySelectorAll || !('draggable' in document.createElement('span'))) { + return; + } + // Add explanation of trigger shortcut to legend box. var explanation = document.createElement('div'); explanation.id = 'osrt-explanation'; @@ -92,18 +97,6 @@ })(); var initMoveInterface = function(){ - //exclude older browsers by the features we need them to support - //and legacy opera explicitly so we don't waste time on a dead browser - if - ( - !document.querySelectorAll - || - !('draggable' in document.createElement('span')) - || - window.opera - ) - { return; } - // Update explanation text and add new legend entries. function addLegend(type) {