Skip to content

Instantly share code, notes, and snippets.

@aq1
Created May 19, 2017 21:35
Show Gist options
  • Save aq1/0b64c67d73777c2994bce7a3c2a12312 to your computer and use it in GitHub Desktop.
Save aq1/0b64c67d73777c2994bce7a3c2a12312 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Remove ads
// @namespace whatevernamespace
// @include https://vk.com/
// @version 1
// @grant none
// ==/UserScript==
var removeAdds = function () {
var adsLeft = document.getElementById('ads_left');
if (adsLeft) {
adsLeft.remove();
}
var posts = document.getElementsByClassName('_ads_promoted_post_data_w');
for (var i = 0; i < posts.length; i++) {
posts[i].remove()
}
};
setInterval(removeAdds, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment