How to make less disturbing?

How to make less disturb you from really important things?
The easiest way it to remove yourself from that social network, or not create an account, If you haven’t got one.
But, what to do, if you have lots of “friends” in, and you can’t contact them in other way?
Or, if You are using music features of

Lets assume, that our task is: make it so, that could be used as messenger and music player at work time. Also, out of the work hours, we want to use full functionality of

This goal could be easilly achieved by userscript, installed through GreasyMonkey/TamperMonkey.

Установка скрипта:

1. Install browser plugin for userscripts

For Firefox it’s GreaseMonkey
For Google Chrome and other browsers, based on it, and not having it’s own plugins store (Chromium, Vivaldi) it’s TamperMonkey
For Opera it’s separated extension TamperMonkey

2. Copy javascript from here:

Or right from here:

// ==UserScript==
// @name only messaging
// @namespace
// @description Allow to use messaging only on
// @include*
// @match*
// @match*
// @version     1
// @grant       none
// @require
// ==/UserScript==

global_vkscript_is_active = false;
global_current_href = '';

function every_page_remove()
function detect_move_out(url)
  var regtxt = "^https://(new\.)?|audios?|away|share|login)";
  var regexp = new RegExp(regtxt);
  if (!regexp.test(url))
     window.location.href = "";

function update_url(url)
        if (global_current_href != url)
            jQuery('#url-box').text('URL:' + url);
            global_current_href = url;
* Function, returning time limits of working
function get_time_limits()
  return {
    // Start to block everything except music and messages from time:
    from: "9:30",
    // Block until time:
    to: "18:30"
* Check, should blocking be active now? 
function is_active(){
  d =;  
  var d1 = new Date(d);
  var d2 = new Date(d);
  var limits = get_time_limits();
  return (d2 > d && d1 < d);  
* Try to activate or deactivate
function tryToActivate()
  if (!global_vkscript_is_active && is_active())
    global_vkscript_is_active = true;
    jQuery('#side_bar li').each(function (index, element) {  
      text = jQuery(element).find('span.left_label.inl_bl').text();      
      if (-1 == jQuery.inArray(text, ["Сообщения", "Музыка"]))
'); update_url(window.location.href); setInterval(function(){ update_url(window.location.href); }, 1000); } else if(global_vkscript_is_active && !is_active()) { window.location.reload(); } } /** * Check for activation every 2 seconds */ setInterval(tryToActivate, 2000); })();

3. Create new userscript in newly installed browser extension, and copy the code to it.


1. Open website, and, if needed, authorize. If have been already opened, the page must be reloaded.

2. If the time now is inside specified limits, all left menu’s items except “Music” and “Messages” should disappear

3. When time goes outside of the specified limits, full left menu would became accessible.

Left bar
in normal state
Left base
when all unneded is blocked

4. Additional bonus: adverstment block on the left sidebar should disappear

5. If you try to enter some page, that is not “messages” or “music” at work-time, redirect to “messages” would happen.

The only disadvantage of this script, is that it doesn’t automatic disable at the weekend of holidays

So, what do you think ?