Guest User

Fix Feedly Links Mod 2013.6.2

a guest
Jun 1st, 2013
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       Fix Feedly Links
  3. // @namespace  http://use.i.E.your.homepage/
  4. // @version    0.1
  5. // @description  Removes the utm_source=feedly parameter from the end of feedly links.
  6. // @match      http://www.feedly.com/*
  7. // @copyright  2013, Francisco Vieira
  8. // @require     http://code.jquery.com/jquery-1.9.1.min.js
  9. // ==/UserScript==
  10.  
  11. $(document).ready(function() {
  12.  
  13.     var BAD_PARAMETER = /[?&]utm_source=.*/;
  14.  
  15.     window.setInterval(function() {
  16.         $('a').each(function(i, link) {
  17.             console.log(link);
  18.             var url = $(link).attr('href');
  19.             console.log(url);
  20.             if (url.match(BAD_PARAMETER)) {
  21.                 var new_url = url.replace(BAD_PARAMETER, "");
  22.                 console.log(new_url);
  23.                 $(link).attr('href', new_url);
  24.             }
  25.         });
  26.     }, 500);
  27.  
  28. });
Advertisement
Add Comment
Please, Sign In to add comment