congdantoancau

Rename title of Facebook web page

Nov 18th, 2021 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.53 KB | None | 0 0
  1. function retitlize() {
  2.     var url_type = 0; // 0 home; 1 profile; 2 watch; 3 group;
  3.     var title = '';
  4.    
  5.     if (window.location.pathname == '/') url_type = 0;
  6.     if (window.location.pathname.split('/').length-2 == 1) url_type = 1;
  7.     if (window.location.pathname.indexOf('watch') !== -1) url_type = 2;
  8.     if (window.location.pathname.indexOf('groups') !== -1) url_type = 3;
  9.    
  10.     if (url_type == 2) title = $('#watch_feed .n1l5q3vz .d2edcug0').eq(0)[0].innerText;
  11.     console.log(title);
  12.    
  13.     if (title !== '')
  14.         $('title').html(title + ' | Facebook')
  15. }
Add Comment
Please, Sign In to add comment