Skip to content

Instantly share code, notes, and snippets.

@dizys
Last active July 17, 2023 13:39
Show Gist options
  • Save dizys/856f9929db5f5d9316339403a7d955e5 to your computer and use it in GitHub Desktop.
Save dizys/856f9929db5f5d9316339403a7d955e5 to your computer and use it in GitHub Desktop.
Browser user script for blocking ads on IYF.tv
// ==UserScript==
// @name IYF Ads Blocker
// @namespace https://dizy.cc
// @version 0.2
// @description Ads blocker for iyf.tv
// @author Dizy
// @include /^https:\/\/(.*?)\.iyf\.tv\//
// @icon https://www.google.com/s2/favicons?sz=64&domain=iyf.tv
// @grant GM_log
// @grant unsafeWindow
// @grant GM_addStyle
// @require https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js
// @require https://git.io/waitForKeyElements.js
// ==/UserScript==
(function() {
'use strict';
GM_log("hello");
GM_addStyle(`
vg-pause-ads, app-gg-block,
.block-center.ng-star-inserted, .player-side.player-right,
.app-download-block, .publicbox.ng-star-inserted,
.use-coin-box, #main-player > .caption,
#preloader, .overlap,
dn-floatads {
display: none !important;
opacity: 0;
pointer-events: none;
}
.page-container.video-player {
width: 100% !important;
}
.playPageTop {
min-height: auto !important;
}
.playPageBottom {
margin-top: 80px;
}
vg-controls {
pointer-events: initial !important;
}
`);
setInterval(() => {
if($("#main-player").hasClass('publicplay')) {
$("#main-player").removeClass('publicplay');
$("#video_player").get(0).play();
}
}, 1000)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment