Last active
August 25, 2017 11:31
-
-
Save LordJZ/5194de8100d8e318489b to your computer and use it in GitHub Desktop.
VK patch reduces background VK messenger traffic 100 times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name VK fixes | |
// @namespace vk-com | |
// @include https://vk.com/* | |
// @include http://vk.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
/* recommended filters in addition to EasyList | |
! ========================= | |
! VK filers | |
! ========================= | |
$third-party,domain=vk.com | |
@@||vk.me^ | |
@@||vk-cdn.net^ | |
/q_frame.php$subdocument,domain=vk.com | |
vk.com###feed_recommends | |
! VK API on other sites | |
||vk.com/js/api/openapi.js*$third-party | |
! VK Widgets on other sites | |
||vk.com/widget*$domain=~vk.com | |
##a[href^="https://vk.com/share.php?url="] | |
*/ | |
let oldPost = window.ajax.post; | |
let regex = /al_update_ad/; | |
window.ajax.post = function (url, args, args2) { | |
if (regex.test(url)) { | |
return; | |
} | |
if (args && args.act) { | |
switch (args.act) { | |
case 'a_typing': | |
case 'a_mark_read': | |
case 'a_mark': | |
//args2 && args2.onDone && args2.onDone(); | |
return; | |
} | |
} | |
oldPost.apply(this, arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment