Skip to content

Instantly share code, notes, and snippets.

@losipiuk
Last active August 29, 2015 14:18
Show Gist options
  • Save losipiuk/c9a909952564183c40a2 to your computer and use it in GitHub Desktop.
Save losipiuk/c9a909952564183c40a2 to your computer and use it in GitHub Desktop.
tampermonkey: disable autoplay for gazeta.tv
// ==UserScript==
// @name Disable autoplay on gazeta.pl
// @namespace http://your.homepage/
// @version 0.1
// @description Disables autoplay for iframe movies coming from www.gazeta.tv
// @author Lukasz Osipiuk
// @match http://*gazeta.pl/*
// @match http://*.sport.pl/*
// @grant none
// ==/UserScript==
var frames = document.querySelectorAll('iframe[src*="gazeta.tv"][src*="autoplay="]'), i = frames.length;
for(i = 0; i < frames.length; ++i) {
newSrc = frames[i].src;
newSrc = newSrc.replace("autoplay=1", "autoplay=0");
newSrc = newSrc.replace("autoplay=true", "autoplay=false");
frames[i].src = newSrc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment