Facebook (Insert View Post Button)

Inserts a View Post button when browsing photos on Facebook — e.g. Navigates away from the standard theater view

اعتبارا من 24-06-2021. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name     Facebook (Insert View Post Button)
// @match    https://www.facebook.com/*
// @match    http://www.facebook.com/*
// @icon     https://www.google.com/s2/favicons?domain=facebook.com
// @run-at   document-start
// @grant    GM_addStyle
// @author   JZersche (Free Release)
// @version 1.00
// @namespace https://greasyfork.org/users/95175
// @description Inserts a View Post button when browsing photos on Facebook — e.g. Navigates away from the standard theater view
// ==/UserScript==

setTimeout(function() {

if(window.location.href.match(/(facebook\.com\/photo\/\?fbid\=\d+\&set\=a\.\d+|facebook\.com\/\S+\/photos\/a\.\d+\/\d+)/)) {

try{

let Facebook_username = document.getElementsByClassName('oajrlxb2 g5ia77u1 qu0x051f esr5mh6w e9989ue4 r7d6kgcz rq0escxv nhd2j8a9 nc684nl6 p7hjln8o kvgmc6g5 cxmmr5t8 oygrvhab hcukyx3x jb3vyjys rz4wbd8a qt6c0cv9 a8nywdso i1ao9s8h esuyzwwr f1sip0of lzcic4wl oo9gr5id gpro0wi8 lrazzd5p')[0].href.match(/com\/\S+\?/)[0].match(/\/\S+/)[0].replace('/','').replace('?','');

try{let postID = window.location.href.match(/\?fbid\=\d+/)[0].match(/\d+/)[0];}catch(e){}
try{let postID2 = window.location.href.match(/facebook\.com\S+\/photos\/a\.\d+\/\d+/)[0].match(/\d+/g)[1];

if(Facebook_username == 'profile.php') {
Facebook_username = postID2};
console.log(Facebook_username);
}catch(e){}

try{let setID = window.location.href.match(/(&set\=a\.\d+)/)[0].match(/\d+/)[0];}catch(e){}
try{let setID2 = window.location.href.match(/(a\.\d+)/)[0];}catch(e){}

try{let EditButton = document.getElementsByClassName('rq0escxv l9j0dhe7 du4w35lb j83agx80 pfnyh3mw taijpn5t bp9cbjyn owycx6da btwxx1t3 kt9q3ron ak7q8e6j isp2s0ed ri5dt5u2 rt8b4zig n8ej3o3l agehan2d sk4xxmp2 d1544ag0 tw6a2znq tdjehn4e tv7at329')[0];

if(EditButton) {
EditButton.insertAdjacentHTML('afterend','<div class="'+EditButton.className+' viewpost" style="font-family: inherit; font-weight:600; font-size:14px; color:#fff!important"><a href="#">View Post</a></div>');
document.getElementsByClassName('viewpost')[0];
}
}catch(e){}

try{
let ViewPostButton = document.getElementsByClassName('a8nywdso j7796vcc rz4wbd8a l29c1vbm')[0];
if(ViewPostButton) {


try{
if(window.location.href.match(/facebook\.com\/\D+/)[0]){
ViewPostButton.insertAdjacentHTML('afterend','<div class="viewpost" style="font-family: inherit; font-weight:600; font-size:14px; color:#fff!important"><a href="http://www.facebook.com/'+window.location.href.match(/facebook\.com\/\S+\/photos/)[0].replace('facebook.com/','').replace('/photos','')+'/posts/'+window.location.href.match(/facebook\.com\S+\/photos\/a\.\d+\/\d+/)[0].match(/\d+/g)[1]+'">View Post</a></div>');
console.log('a');
}
}catch(e){}

try{
if(window.location.href.match(/facebook\.com\/\d+/)[0]) {
ViewPostButton.insertAdjacentHTML('afterend','<div class="viewpost" style="font-family: inherit; font-weight:600; font-size:14px; color:#fff!important"><a href="http://www.facebook.com/'+window.location.href.match(/facebook\.com\/\S+\/photos/)[0].replace('facebook.com/','').replace('/photos','')+'/posts/'+window.location.href.match(/facebook\.com\S+\/photos\/a\.\d+\/\d+/)[0].match(/\d+/g)[2]+'">View Post</a></div>');
console.log('b');
}
}catch(e){}

}


}catch(e){}

}

catch(e){}


}

},5000);