Fork Copy chrome.webRequest.onBeforeRequest.addListener( (details) => { href = details.url; var length = href.length; if (href[length - 1] == '/') href = href.substr(0, length - 1); var _i = href.indexOf('?'); if (_i == -1) _i = 100000; if (href.indexOf('facebook.com') > -1 && href.substring(0, _i - 1).split('/').length <= 3) { if (config['redirect_news_feed']) { return { redirectUrl: config['redirect_news_feed_url'] } } return {}; } for (let i = 0; i < listReaction.length; i++) { reaction = listReaction[i]; if (href.indexOf(reaction.from) > -1) { return { redirectUrl: reaction.to } } } // https://graph.facebook.com/${friend.id}/picture?type=large&redirect=true&width=40&height=40 var listChangeAvatar = config['change_friends_avatar']; let len = listChangeAvatar.length; for (let i = 0; i < len; i++) { let friend = listChangeAvatar[i]; if (href.indexOf('fbcdn.net') > -1 && href.indexOf(friend.avatar_id) > -1) { return { redirectUrl: friend.avatar } } } }, { urls: [""] }, ["blocking"] ); https://5-edge-chat.facebook.com/pull