// ==UserScript==
// @name         pr0-fav-in-nav
// @namespace    http://pr0gramm.com/user/playmax
// @version      1.0
// @description  Adds a heart-shaped link to the users favorites in the navigation bar
// @author       playmax
// @match        http://pr0gramm.com/*
// @match        https://pr0gramm.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

jQuery(function() {
  var data = jQuery.parseJSON(decodeURI($.cookie('me')));
  var link = jQuery("<a id='tab-fav' class='head-tab' href='/user/" + data.n + "/likes'>❤</a>");
  jQuery("#filter-link").before(link);
  
  if(/likes/.test(window.location.href)) {
    $('#tab-fav').addClass('active');
  }
});

// ==UserScript==
// @name         pr0-fav-in-nav
// @namespace    http://pr0gramm.com/user/playmax
// @version      1.0
// @description  Adds a heart-shaped link to the users favorites in the navigation bar
// @author       playmax
// @match        http://pr0gramm.com/*
// @match        https://pr0gramm.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

jQuery(function() {
  var data = jQuery.parseJSON(decodeURI($.cookie('me')));
  var link = jQuery("<a id='tab-fav' class='head-tab' href='/user/" + data.n + "/likes'>❤</a>");
  jQuery("#filter-link").before(link);
});
--- 
+++ 
@@ -14,4 +14,8 @@
   var data = jQuery.parseJSON(decodeURI($.cookie('me')));
   var link = jQuery("<a id='tab-fav' class='head-tab' href='/user/" + data.n + "/likes'>❤</a>");
   jQuery("#filter-link").before(link);
+  
+  if(/likes/.test(window.location.href)) {
+    $('#tab-fav').addClass('active');
+  }
 });
Add active class if fav selected