-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadsenseShield (KoranArtikel).min.js
37 lines (29 loc) · 2.79 KB
/
adsenseShield (KoranArtikel).min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
jQuery(document).ready(function ($) {
/*
AdSenseShield v 0.1 (Minified Version)
AdSenseShield is a click spam/bomb protection.
How it works:
The AdSenseShield work by assumption.
AdsShield assume that the link below the cursor causing a web page move to another page when it happen.
If the link was arround adsShield area upon page move, it will then recognized as a click.
When a click reach a certain number, adsShield will prevent user to view the protected area (in this case ads).
With the same assumption, when a user roughly clicking adsShield area in intention for spamming clicks,
it will then immediately hide the area after certain clicks as defined on configuration.
Version:
Curent version of adsShield : V 0.1
This is an early develpment, use it at your own risk.
Know bugs:
1. Right/CTRL click to open new tab/window not tracked.
2. If user use TAB to navigate to the link while cursor hovering the ads, it will be tracked as click.
3. Only work on new web browser (actually, only tested on Latest Firefox, Chrome and IE9).
Licence:
This script only using with VPilot Script by Vore Corporation
*/
// Edit here for AdSenseShield Configuration
var myDomain = 'www.koran-artikel.info';
var ASVarCookie = myDomain + '_adsenseShield'; // Cookie Name for Ads Shield
var ASBlock = 1; // How long ads will be hidden (in days)
var ASClick = 3; // Max Click Number before hiding
var ASTag = '.adslot_1'; // DIV Tag Class name
// Edit should stop here unless you know what you're doing
var ASHoverAds=false;if(ASMaxClick(ASVarCookie,ASClick)){$(ASTag).hide('fast');};$(ASTag).bind('mouseover',function(){ASHoverAds=true;}).bind('mouseout',function(){ASHoverAds=false;});$(window).on('beforeunload',function(){if(ASHoverAds){if(ASMaxClick(ASVarCookie,ASClick)){$(ASTag).hide('fast');}else{ASSetCookieAds(ASVarCookie,ASBlock);};};});});function ASSetCookie(ASCName,value,exdays){var exdate=new Date();exdate.setDate(exdate.getDate()+exdays);var c_value=escape(value)+((exdays==0)?";path=/":"; expires="+exdate.toUTCString())+";path=/";document.cookie=ASCName+"="+c_value;};function ASGetCookie(ASCName){var i,x,y,ASCookies=document.cookie.split(";");for(i=0;i<ASCookies.length;i++){x=ASCookies[i].substr(0,ASCookies[i].indexOf("="));y=ASCookies[i].substr(ASCookies[i].indexOf("=")+1);x=x.replace(/^\s+|\s+$/g,"");if(x==ASCName){return unescape(y);};};};function ASSetCookieAds(ASCookieName,ASDays){var ASTheCookie=ASGetCookie(ASCookieName);if((ASTheCookie!=undefined)&&(ASTheCookie!='')){ASTheCookieInt=parseInt(ASTheCookie)+1;ASSetCookie(ASCookieName,ASTheCookieInt.toString(),0);}else{ASSetCookie(ASCookieName,'1',ASDays);};};function ASMaxClick(ASCookieName,bK){var ASTheCookie=ASGetCookie(ASCookieName);if((ASTheCookie!=undefined)&&(parseInt(ASTheCookie)>=bK)){return true;}else{return false;};};