Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name MikroBox
- // @namespace MikroBox
- // @include http://www.wykop.pl/mikroblog/*
- // @include http://www.wykop.pl/tag/*
- // @author P0lip
- // @version 1
- // @grant none
- // ==/UserScript==
- (function(){
- "use strict";
- const target = document.getElementById("newEntriesCounter");
- const observer = new MutationObserver(function(mutations){
- mutations.forEach(function(){
- let click = target.querySelector("a.dark");
- if(click)
- click.click();
- });
- });
- if(target)
- observer.observe(target, { childList: true });
- Array.prototype.forEach.call(document.getElementsByName("btnReply"), function(elem){
- elem.addEventListener("click", function(){
- observer.disconnect();
- });
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement