Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    What other plugins and theme do you use on the site?

    Thread Starter clausgc

    (@clausgc)

    @takayukister

    hi – I use the same basic plugins I do with several other sites – I did find the issue: a script in the header I added some months ago to “use passive listeners to improve scrolling performance”

    Below the script:
    <script>
    (function() {
    var supportsPassive = eventListenerOptionsSupported();

    if (supportsPassive) {
    var addEvent = EventTarget.prototype.addEventListener;
    overwriteAddEvent(addEvent);
    }

    function overwriteAddEvent(superMethod) {
    var defaultOptions = {
    passive: true,
    capture: false
    };

    EventTarget.prototype.addEventListener = function(type, listener, options) {
    var usesListenerOptions = typeof options === ‘object’;
    var useCapture = usesListenerOptions ? options.capture : options;

    options = usesListenerOptions ? options : {};
    options.passive = options.passive !== undefined ? options.passive : defaultOptions.passive;
    options.capture = useCapture !== undefined ? useCapture : defaultOptions.capture;

    superMethod.call(this, type, listener, options);
    };
    }

    function eventListenerOptionsSupported() {
    var supported = false;
    try {
    var opts = Object.defineProperty({}, ‘passive’, {
    get: function() {
    supported = true;
    }
    });
    window.addEventListener(“test”, null, opts);
    } catch (e) {}

    return supported;
    }
    })();
    </script>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Mail sends twice’ is closed to new replies.