Skip to content

Instantly share code, notes, and snippets.

@noopkat
Created June 23, 2019 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noopkat/16befc1ee4f6840a2a4ebb51c370feb8 to your computer and use it in GitHub Desktop.
Save noopkat/16befc1ee4f6840a2a4ebb51c370feb8 to your computer and use it in GitHub Desktop.
Tampermonkey script for pausing autoplaying videos on pinterest only
// ==UserScript==
// @name Pinterest Autoplay Remover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description pauses autoplaying / looping videos
// @author @noopkat
// @match https://www.pinterest.com
// @grant none
// ==/UserScript==
// beware: this is quick and dirty because it gets the job done and that's all I care about.
(function() {
'use strict';
const observer = new MutationObserver((mutations) => document.querySelectorAll('video').forEach(video => video.pause()));
const observerConfig = {
childList: true,
subtree: true
};
const targetNode = document.body;
observer.observe(targetNode, observerConfig);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment