|
1 | 1 | // ==UserScript==
|
2 | 2 | // @name Digitally Imported Userscript
|
3 | 3 | // @namespace LTKDIFMU
|
4 |
| -// @version 2016.1.31 |
| 4 | +// @version 2017.3.18 |
5 | 5 | // @author LethaK Maas
|
6 | 6 | // @description Removes afk popup and minimize ads if possible
|
7 | 7 | // @include http://www.di.fm*
|
|
12 | 12 | // @grant none
|
13 | 13 | // ==/UserScript==
|
14 | 14 | (function () {
|
| 15 | + setInterval(function(){ |
15 | 16 |
|
16 |
| -setInterval(function(){ |
| 17 | + try{ |
17 | 18 |
|
18 |
| -// AFK MUTE |
19 |
| -di.app.timedAlerts.stop(); |
20 | 19 |
|
21 |
| -// Ads |
22 |
| -//AudioAddict.WP.AdManager.providers = {} |
23 |
| -//AudioAddict.Ad.adswizz = {}; |
24 |
| -AudioAddict.WP.wp.adManager.stop(); |
25 |
| -AudioAddict.webplayer.adblocks.gracePeriodTimer_.finish_(); |
26 |
| -AudioAddict.webplayer.adblocks.gracePeriodTimer_.stop(); |
27 |
| -AudioAddict.webplayer.adblocks.adEnd_(); |
28 |
| -AudioAddict.webplayer.adblocks.adBlockEnd(); |
| 20 | + jQuery('[id^="adprovider"]').remove(); |
| 21 | + //$(document).trigger("ad-end"); |
| 22 | + //di.eventbus.trigger("webplayer:ad:end"); |
29 | 23 |
|
| 24 | + jQuery(document).on("ad-begin", function(e){ |
| 25 | + console.warn('Ad begin event (muting) ', e); |
| 26 | + AudioAddict.WP.wp.mute(); |
| 27 | + }); |
| 28 | + jQuery(document).on("ad-end", function(e){ |
| 29 | + console.warn('Ad end event (unmuting) ', e); |
| 30 | + AudioAddict.WP.wp.unMute(); |
| 31 | + }); |
30 | 32 |
|
31 |
| -// Ads panel |
32 |
| -jQuery('#panel-ad > div.panel-header > div.icon-cross3.panel-close.icon').trigger('click'); |
33 | 33 |
|
34 |
| -},2000); |
| 34 | + di.app.module("WebplayerApp.Ads.Adblocks").logger = new di.log.Console("WebplayerApp.Ads.Adblocks (Silenced)"); |
| 35 | + di.app.module("WebplayerApp.Ads.Supervisor").logger = new di.log.Console("WebplayerApp.Ads.Supervisor (Silenced)"); |
35 | 36 |
|
36 |
| -}) () |
| 37 | + di.app.module("WebplayerApp.Ads.Adblocks").adHasVisual = function(){ |
| 38 | + return false; |
| 39 | + }; |
| 40 | + |
| 41 | + di.app.module("WebplayerApp.Ads.Adblocks").onAdBlockEnd = function(){ |
| 42 | + this.adblockActive = !1; |
| 43 | + di.eventbus.trigger("webplayer:adblock:end"); |
| 44 | + }; |
| 45 | + |
| 46 | + di.app.module("WebplayerApp.Ads.Adblocks").onAdBegin = function(e, t) { |
| 47 | + return void 0; |
| 48 | + }; |
| 49 | + |
| 50 | + NS("AudioAddict.WP.AdManager").providers = null; |
| 51 | + NS("AudioAddict.WP.AdManager.providers"); |
| 52 | + |
| 53 | + di.app.module("WebplayerApp.Ads.Supervisor").supervise = function(e){}; |
| 54 | + di.app.module("WebplayerApp.Ads.Supervisor").eligibleForPreroll = function(){return false;}; |
| 55 | + di.app.module("WebplayerApp.Ads.Supervisor").eligibleForMidroll = function(){return false;}; |
| 56 | + di.app.module("WebplayerApp.Ads.Supervisor").requestAd = function(e){}; |
| 57 | + di.app.module("WebplayerApp.Ads.Supervisor").selectAds_ = function(e){return [];}; |
| 58 | + di.app.module("WebplayerApp.Ads.Supervisor").startAd = function(e){return }; |
| 59 | + di.app.module("WebplayerApp.app.webplayer").submodules.ads = null; |
| 60 | + di.app.timedAlerts.stop(); |
| 61 | + di.app.WebplayerApp.Ads.Provider = null; |
| 62 | + //AudioAddict.WP.wp.adManager.stop(); |
| 63 | + |
| 64 | + //AudioAddict.WP.adManager = null; |
| 65 | + //AudioAddict.WP.wp.adManager = null; |
| 66 | + |
| 67 | + NS("AudioAddict.WP").AdManager = null; |
| 68 | + NS("AudioAddict.WP").AdProvider = null; |
| 69 | + di.app.webplayer.ads = null; |
| 70 | + |
| 71 | + NS("AudioAddict.WP.wp").initAdManager = function(){ return null;}; |
| 72 | + |
| 73 | + |
| 74 | + jQuery('.premium-upsell').remove(); |
| 75 | + } catch(ex){ |
| 76 | + console.warn('An error occured while silencing ads', ex); |
| 77 | + } |
| 78 | + |
| 79 | + }, 500); |
| 80 | +})(); |
0 commit comments