FB: Post Tools & Statistics

Shows exact timestamps and post information on Facebook Posts.

  1. // ==UserScript==
  2. // @name FB: Post Tools & Statistics
  3. // @match https://www.facebook.com/*
  4. // @match https://*.facebook.com/*
  5. // @match http://www.facebook.com/*
  6. // @match http://*.facebook.com/*
  7. // @run-at document-start
  8. // @grant GM_addStyle
  9. // @author JZersche & wOxxOm
  10. // @require https://greasyfork.org/scripts/12228/code/setMutationHandler.js
  11. // @██require https://momentjs.com/downloads/moment.min.js
  12. // @███require https://momentjs.com/downloads/moment-with-locales.min.js
  13. // @████require https://html2canvas.hertzen.com/dist/html2canvas.js
  14. // @version 1.29
  15. // @namespace https://greasyfork.org/users/95175
  16. // @description Shows exact timestamps and post information on Facebook Posts.
  17. // ==/UserScript==
  18.  
  19. var options = {
  20. weekday: 'long',
  21. year: 'numeric',
  22. month: 'numeric',
  23. day: '2-digit'
  24. };
  25.  
  26. //GM_addStyle('');
  27.  
  28. // process the already loaded portion of the page if any
  29. expandDates(document.querySelectorAll('abbr[data-utime]'));
  30. RecentTimestamps(document.querySelectorAll('.q_1zif-zjsq'));
  31. RecentPostURLs(document.querySelectorAll('.q_1zif-zjsq, ._5r69, ._6ks'));
  32. ExternalURLs(document.querySelectorAll('._52c6'));
  33. expandPostIDs(document.querySelectorAll('._5pcq'));
  34. document.querySelectorAll('.hasCaption');
  35. // process the stuff added from now on
  36. setMutationHandler(document, 'abbr[data-utime]', expandDates);
  37. setMutationHandler(document, '.q_1zif-zjsq', RecentTimestamps);
  38. setMutationHandler(document, '.q_1zif-zjsq, ._5r69, ._6ks', RecentPostURLs);
  39. setMutationHandler(document, '._52c6', ExternalURLs);
  40. setMutationHandler(document, '._5pcq', expandPostIDs);
  41. /*
  42. html2canvas(document.querySelector('._3576')).then(canvas => {
  43. document.getElementsByClassName('s2img')[0].addEventListener('click', function(event) {node.insertAdjacentHTML('afterend', canvas.toDataURL());})
  44. });
  45. */
  46. setMutationHandler({
  47. target: document.querySelector('._3576'),
  48. selector: '.s2img',
  49. handler: nodes => nodes.forEach(node => { node.setAttribute("style", "color: red; border: 0px solid red;");
  50. var Wwidth = window.innerWidth;
  51. var Wheight = window.innerHeight;
  52. node.addEventListener('click', function (event) { /* Ends at Line 712 */
  53. //node.closest('._5pcp._5lel').setAttribute("style", "font-size: 7px;line-height: 16px;");
  54. node.setAttribute("style", "color: #5550; border: 1px solid #0000; display:none;");
  55. node.nextSibling.setAttribute("style", "color: #00ff; border: 0px solid #00ff; display:inline-block;");
  56.  
  57. //console.log(event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className);
  58. //event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("style", "background:#222;");
  59. //////var PageTitleColorPROMPT = '#fff';
  60. var PageTitleColorPROMPT = prompt('Enter the HTML Hex Color # the Page Title should be:','#fff');
  61. /* Name of Page Color Change on Click */
  62. /* Likes Information (Hide/Show) */
  63. var classCheck0 = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.children;
  64. console.log('64var classCheck0 = '+event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.children.className);
  65. var classCheck1 = event.target.parentNode.children;
  66. console.log('66var classCheck1 = '+event.target.parentNode.children.className);
  67. var classCheck2 = event.target.parentNode;
  68. console.log('68var classCheck2 = '+event.target.parentNode.className);
  69.  
  70.  
  71. console.log('classCheck0: '+classCheck0.length+'\n'+'window.innerWidth: '+Wwidth);
  72.  
  73. if (classCheck0.length >= 0 && Wwidth<=1440 && window.location.href.match(/(https:\/\/www\.facebook\.com\/(\w+)\/posts\/\d+)/))
  74. {
  75. console.log('Line 63 – initialize wWOffset variable');
  76. var wWOffset;
  77. if(window.innerWidth == 1440) {wWOffset = 401;} // Check if windows innerWidth is equal to 1440
  78. else if (window.innerWidth == 1402) {wWOffset = 441;} // Check if windows innerWidth is equal to 1402
  79. else if (window.innerWidth == 1255) {wWOffset = 312.5;} // Check if windows innerWidth is equal to 1255
  80.  
  81. /* Unsupported Resolution Algorithm */ /* Compress this into unreadable confusion later */
  82. else
  83. {
  84. alert('Detected an.... innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  85. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right.(probably) (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  86. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0-0.0-OffsetXs;}
  87.  
  88. if (OffsetXs <= 0) {
  89. OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (or right possibly) (Screenshot Offset - Add X Axis');
  90. wWOffset = window.innerWidth/3-123.0-0.0-OffsetXs+OffsetXp;
  91. }
  92.  
  93. }
  94.  
  95. /* * * * * –> Styling */ console.log('URL is supported [Mode 0|1] —> Version. 1.30 :: ' + window.location.href);
  96. event.target.parentNode.setAttribute("style", "background:purple;");
  97. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: orange; display:block; border:0px solid #111!important;");
  98. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: blue; display:block; border:0px solid #111!important;");
  99. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:lime;");
  100. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  101. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  102. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:cyan;");
  103. //////////// <– End Styling
  104.  
  105. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined)
  106. {
  107. node.nextSibling.value = 'Archived Post [Mode: 0]';console.log('╜');console.log('Capture: Mode #0');
  108. document.querySelectorAll('.n_1zif-ycce.h_1zif-v9xd.clearfix').setAttribute('style','border:1px dashed #f0f');
  109. node.nextSibling.setAttribute('style','color:#f04;background:#11a0;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px');
  110. // Insert unnecessary bullshit //document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  111. // Insert more unnecessary bullshit //document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  112. event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  113. // Hmm //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  114. // Hmm //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  115. // Style Page Title //
  116. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  117. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  118. } else {
  119. node.nextSibling.value = 'Archived Post [Mode: 1]';
  120. node.nextSibling.setAttribute('style','color:#f04;background:cyan;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  121. console.log('Capture: Mode #1'); console.log('╜╜');
  122. }
  123. var iCapture = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode;
  124. html2canvas(iCapture, {useCORS: true, backgroundColor: 'lime', logging: true, x: wWOffset, y: 425, width: 510}).then(canvas => {
  125. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  126. var iNameGen = Math.random().toString(36).substring(2, 15);
  127. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  128. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  129. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  130. setTimeout(function () {
  131. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  132. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  133. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #458B97;color: #f68;float: right;border: 1px solid #9990;');
  134. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base641';
  135. /* Likes Information (Hide) */
  136. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  137. }, 0);
  138. })
  139. }
  140. else if (event.target.parentNode.children.length >= 0 && window.innerWidth <= 1725 && window.location.href.match(/(https:\/\/www\.facebook\.com\/\d+|\D+|\d+\D+|\D+\d+\/photos\/\w\.\d+\/\d+)/)) {
  141. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  142. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #522; display:block; border:0px solid #111!important;"); /* Status Main Background */
  143. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #a220; display:block; border:0px solid #111!important;"); /* Status Wrapper for Main Context Information */
  144. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#a0a; border-radius:10px;"); /* Status Main Context Information*/
  145.  
  146. console.log('URL is supported by Mode(s) 2/3. — Script Version 1.18 — OK :) :: ' + window.location.href);
  147.  
  148. if(window.innerWidth == 1440) { wWOffset = 401; }
  149. else if (window.innerWidth == 1402) { wWOffset = 382; }
  150. else if (window.innerWidth == 1255) { wWOffset = 312.5; alert('147') }
  151.  
  152. /* Unsupported Resolution Algorithm */
  153. else { alert('Detected an... innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  154. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  155. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  156. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  157. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  158. }
  159.  
  160.  
  161.  
  162. ///////event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("style","background:red;");
  163. ///////event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:green;");
  164. ///////event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  165.  
  166. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined)
  167. {
  168. // event.target.closest('._4-u2').setAttribute("style", "background:#00f0;");
  169. node.nextSibling.value = 'Archived Post [Mode: 2]';
  170. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  171. // node.nextSibling.setAttribute('style','color:#0f4;background:#1110;border:1px solid #0f4;text-align:left;:font-size:10px;');
  172. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  173. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  174. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  175. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  176. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  177. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  178. } else {
  179. //NotNeeded//event.target.closest('._4-u2').setAttribute("style", "background:#f00f;");
  180. node.nextSibling.value = 'Archived Post [Mode: 3]';
  181. node.nextSibling.setAttribute('style','color:#40f;background:pink;border:1px solid #40f;text-align:left;:font-size:10px;'); /* Archived Post Label */
  182. }
  183.  
  184. //if(!window.location.href.match(/\d/)) {};
  185. //node.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.children[1].children[2].children[1].children[0].children[0].children[1].children[1].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  186. //node.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.children[1].children[2].children[1].children[0].children[0].children[1].children[1].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  187. var iCaptureM3 = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode;
  188. //setTimeout(function () {
  189. html2canvas(iCaptureM3, {useCORS: true, backgroundColor: '#00f', logging: true, x: wWOffset, y: 425, width: 510}).then(canvas => {
  190. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  191. var iNameGen = Math.random().toString(36).substring(2, 15);
  192. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  193. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  194. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  195. setTimeout(function ()
  196. {
  197. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  198. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  199. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  200. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base645';
  201. /* Likes Information (Show) */
  202. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  203. }, 0);
  204. });
  205. //}, 100);
  206.  
  207. }
  208.  
  209.  
  210. else if (classCheck0.length >= 0 && window.innerWidth <= 1440 && window.location.href.match(/facebook.com\/.+\w+\/posts\/\d+|facebook\.com\/(\D+|\D+\d+)\/posts\/\d+/) && event.target.parentNode.parentNode.parentNode.parentNode.innerText.match(/[A-Z]\D+\s[A-Z]\D+/)) {
  211. console.log('Line 204');
  212. console.log('URL is supported by Mode(s) 4/5. — Script Version 1.11 — OK :) :: ' + window.location.href);
  213.  
  214. if(window.innerWidth == 1440) {wWOffset = 401;}
  215. else if (window.innerWidth == 1402) {wWOffset = 371;}
  216. else if (window.innerWidth == 1255) {wWOffset = 340;}
  217. /* Unsupported Resolution Algorithm */
  218. else { alert('Detected an (Line 211) innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  219. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  220. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  221. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  222. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  223. }
  224.  
  225. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined && window.location.href.match(/Elted/)) {
  226. var iCaptureM4 = event.target.closest('._4-u2');
  227. node.nextSibling.value = 'Archived Post [Mode: 4]';
  228. event.target.parentNode.setAttribute("style", "background:red;");
  229. event.target.closest('._1dwg._1w_m._q7o').nextSibling.setAttribute("style","display:none;");
  230.  
  231. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #EDBB33; display:block; border:0px solid #222!important;");
  232. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: blue; display:block; border:0px solid #222!important;");
  233. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  234. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: orange; display:block; border:0px solid #222!important;");
  235. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: magenta; display:block; border:0px solid #222!important;");
  236. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  237. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  238. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  239. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:purple;");
  240. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:cyan;");
  241. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:F02AFC;");
  242. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:yellow;");
  243. node.nextSibling.setAttribute('style','color:#45d;background:#1110;border:1px solid #45d;text-align:left;:font-size:10px;');
  244.  
  245. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  246. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  247. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  248. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  249. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  250. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  251. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  252. html2canvas(iCaptureM4, {useCORS: true, backgroundColor: '#1f1', logging: true, x: wWOffset, y: 65, width: 509}).then(canvas => {
  253. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  254. var iNameGen = Math.random().toString(36).substring(2, 15);
  255. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  256. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  257. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  258. setTimeout(function () {
  259. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  260. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  261. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #2220;color: #86f;float: right;border: 1px solid #9990;');
  262. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base6411';
  263. /* Likes Information (Show) */
  264. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  265. }, 0);
  266. });
  267. }
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289. // Confusing code
  290. // But actually quite simple.
  291.  
  292. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] == undefined)
  293. {
  294. alert('Line 300 querySelector\(n_1zif-ycce.h_1zif-v9xd.clearfix\).nextSibling.nextSibling.children[1] == undefined');
  295. if(window.innerWidth == 1440) {wWOffset = 401;}
  296. else if (window.innerWidth == 1402) {wWOffset = 388;}
  297. else if (window.innerWidth == 1255) {wWOffset = 312.5;}
  298.  
  299. /* Unsupported Resolution Algorithm */
  300. else {
  301. alert('Detected an (Line 268) innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  302. var OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  303. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  304. if (OffsetXs <= 0) {
  305. var OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  306. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp;
  307. }
  308. }
  309.  
  310. alert('Line 300-318 '+event.target.parentNode.className);
  311. node.nextSibling.value = 'Archived Post [Headache Mode: 5]';
  312. iCaptureM5 = event.target.closest('._1dwg._1w_m._q7o');
  313.  
  314. event.target.parentNode.setAttribute("style", "background:#0000;");
  315. event.target.previousSibling.previousSibling.setAttribute("style", "color:#fff;");
  316. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:#111;");/*
  317. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:#f00;");
  318. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:blue;");
  319. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:blue;");
  320. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:magenta;");
  321. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:magenta;");
  322. /* Hide */ event.target.closest('._5pcr.userContentWrapper').children[1].setAttribute("style", "display:none;");
  323. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: blue; display:block; border:0px solid #222!important;");
  324. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: yellow; display:block; border:0px solid #222!important;");
  325. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  326. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  327. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  328. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:cyan;");
  329. event.target.closest('._1dwg._1w_m._q7o').nextSibling.setAttribute("style","display:none;");
  330. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  331. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  332. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: red; display:block; border:0px solid #222!important;");
  333. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #f0f; background: gray; display:block; border:0px solid #222!important;");
  334. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: red; display:block; border:0px solid #222!important;");
  335. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #ff0; background: gray; display:block; border:0px solid #222!important;"); event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  336. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:orange;");
  337. node.nextSibling.setAttribute('style','color:#29d;background:#1110;border:1px solid #29d;text-align:left;:font-size:10px;');
  338. html2canvas(iCaptureM5, {useCORS: true, backgroundColor: '#f11', logging: true, x: wWOffset, y: 425, width: 502}).then(canvas => {
  339. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  340. var iNameGen = Math.random().toString(36).substring(2, 15);
  341. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  342. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  343. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  344. setTimeout(function () {
  345. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  346. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  347. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  348. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base64';
  349. /* Likes Information (Show) */
  350. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  351. }, 0);
  352. });
  353. }
  354.  
  355. else {
  356. node.nextSibling.value = 'Archived Post [Mode: 6]';
  357. event.target.parentNode.parentNode.setAttribute("style", "background:red;");
  358. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  359. node.nextSibling.setAttribute('style','color:#29d;background:#1110;border:1px solid #29d;text-align:left;:font-size:10px;');
  360.  
  361. if(window.innerWidth == 1440) {wWOffset = 401;}
  362. else if (window.innerWidth == 1402) {wWOffset = 381;}
  363. /* Unsupported Resolution Algorithm */
  364.  
  365. else {
  366. alert
  367. (
  368. '0 window.innerWidth: ' + window.innerWidth + '\n' +
  369. '1 Script hasn\'t been optmized for use with this resolution.' + '\n' +
  370. '2 Screenshot will be off center.' + '\n' +
  371. '3 node.className: ' + node.className + '\n' +
  372. '4 node.innerHTML: ' + node.innerHTML + '\n' +
  373. '5 node.nextSibling.className: ' + node.nextSibling.className + '\n' +
  374. '6 node.nextSibling.value: ' + node.nextSibling.value + '\n' +
  375. '7 event.target.parentNode.parentNode.className: ' + event.target.parentNode.parentNode.className + '\n' +
  376. //'8 event.target.parentNode.parentNode.innerHTML: ' + event.target.parentNode.parentNode.innerHTML + '\n' +
  377. '8 event.target.parentNode.parentNode.innerText: \n' + event.target.parentNode.parentNode.innerText + '\n'
  378. )
  379. //'event.target.parentNode.parentNode.value: ' + event.target.parentNode.parentNode.value + '10\n');
  380. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  381. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  382. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  383. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  384. }
  385.  
  386. var iCaptureM6 = event.target.closest('._1dwg._1w_m._q7o');
  387. html2canvas(iCaptureM6, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 425, width: 509}).then(canvas => {
  388. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  389. var iNameGen = Math.random().toString(36).substring(2, 15);
  390. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  391. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  392. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  393. setTimeout(function ()
  394. {
  395. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  396. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  397. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  398. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base640';
  399. /* Likes Information (Show) */ event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  400. }, 0);
  401. });
  402. }
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424. }
  425.  
  426.  
  427. else if (classCheck0.length >= 0 && window.innerWidth <= 1440 && window.location.href.match(/facebook.com\/.+\w+\/posts\/\d+|facebook\.com\/(\D+|\D+\d+)\/posts\/\d+/)) {
  428. console.log('Line 359');
  429. console.log('URL is supported by Mode(s) 7/8. — Script Version 1.18 — OK :) :: ' + window.location.href);
  430.  
  431. if(window.innerWidth == 1440) {wWOffset = 401;}
  432. else if (window.innerWidth == 1402) {wWOffset = 382;}
  433. /* Unsupported Resolution Algorithm */
  434. else { alert('Detected an......... innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  435. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  436. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  437. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  438. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  439. }
  440.  
  441. event.target.closest('._5pcr.userContentWrapper').children[1].setAttribute("style", "display:none;");
  442. event.target.parentNode.setAttribute("style", "background:#D96C32;");
  443. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: red; display:block; border:0px solid #222!important;");
  444. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: gray; display:block; border:0px solid #222!important;");
  445. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  446. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].childNodes[0].setAttribute("style", "border-bottom: 2px solid #0000;");
  447. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  448. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:purple;");
  449. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:lime;");
  450. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:lime;");
  451. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:lime;");
  452.  
  453. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  454. node.nextSibling.value = 'Archived Post [Mode: 7]';
  455. node.nextSibling.setAttribute('style','color:#45d;background:#1110;border:1px solid #45d;text-align:left;:font-size:10px;');
  456.  
  457. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  458. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  459. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  460. ////event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  461. ////event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  462. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  463. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  464. } else { node.nextSibling.value = 'Archived Post [Mode: 8]'; node.nextSibling.setAttribute('style','color:#29d;background:#1110;border:1px solid #29d;text-align:left;:font-size:10px;'); }
  465.  
  466. //var iCaptureM5 = event.target.closest('._4-u2');
  467. var iCaptureM5 = event.target.closest('._1dwg._1w_m._q7o');
  468.  
  469.  
  470. html2canvas(iCaptureM5, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 425, width: 510}).then(canvas => {
  471. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  472. var iNameGen = Math.random().toString(36).substring(2, 15);
  473. event.target.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  474. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  475. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  476. setTimeout(function () {
  477. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  478. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  479. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  480. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base643';
  481. /* Likes Information (Show) */
  482. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  483. }, 0);
  484. });
  485.  
  486. }
  487.  
  488.  
  489. else if (!classCheck2.length && Wwidth<=1920 && window.location.href.match(/(https:\/\/www\.facebook\.com\/\w+\/\d+\/permalink\/\d+\/)/)) {
  490. console.log('Line 420');
  491.  
  492. function minusPercent(n,p) {return n - (n * (p/100));}
  493. /* <— (Subtraction) */
  494. /* 200 pixels increase = subtract 33.25 */
  495. /* 1 pixel increase = subtract 0.16625 */
  496. var w1920 = -8.5;
  497. var w1725 = 23.689;
  498. var w1600 = 44.70;
  499. var w1542 = 54.3425;
  500. var w1500 = 61.325;
  501. var w1450 = 69.6375;
  502. var w1400 = 77.95;
  503. var w1200 = 111.20;
  504. var w1172 = 115.63;
  505. /* —> (Addition) */
  506.  
  507.  
  508. if (window.innerWidth == 1920) {wWOffset = window.innerWidth / 3 - w1920;}
  509. else if (window.innerWidth == 1725) {wWOffset = window.innerWidth / 3 - w1725;}
  510. else if (window.innerWidth == 1600) {wWOffset = window.innerWidth / 3 - w1600;}
  511. else if (window.innerWidth == 1500) {wWOffset = window.innerWidth / 3 - w1500;}
  512. else if (window.innerWidth == 1542) {wWOffset = window.innerWidth / 3 - w1542;}
  513. else if (window.innerWidth == 1450) {wWOffset = window.innerWidth / 3 - w1450;}
  514. else if (window.innerWidth == 1400) {wWOffset = window.innerWidth / 3 - w1400;}
  515. else if (window.innerWidth == 1200) {wWOffset = window.innerWidth / 3 - w1200;}
  516. else if (window.innerWidth == 1172) {wWOffset = window.innerWidth / 3 - w1172;}
  517.  
  518. /* Unsupported Resolution Algorithm */
  519. else {
  520. alert('Detected an....... innerWidth of ' + window.innerWidth + '! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  521. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).');
  522. OffsetXs = OffsetXs * 3;
  523. if (OffsetXs => 100) {
  524. wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0 - OffsetXs;
  525. }
  526. if (OffsetXs <= 0) {
  527. OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  528. wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0 - OffsetXs + OffsetXp;
  529. }
  530. }
  531.  
  532. console.log('URL is supported 9/10 by script. 1.20 Version. OK :) :: ' + window.location.href);
  533. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: lime; display:block; border:0px solid #111!important;"); /* Status Main Background */
  534. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#0000; border-radius:10px;"); /* Status Main Context Information */
  535. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #0000; display:block; border:0px solid #111!important;"); /* Status Main Context */
  536. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#00ff;");
  537. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  538.  
  539. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  540. node.nextSibling.value = 'Archived Post [Mode: 9]';
  541. node.nextSibling.setAttribute('style', 'color:#f04;background:#1110;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  542. console.log('Capture: Mode #2');
  543. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style', 'background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  544. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style', 'display:none;');
  545. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  546. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  547. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  548. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  549. }
  550. else {
  551. node.nextSibling.value = 'Archived Post [Mode: 10]';
  552. /*Software Used:*/
  553. if (node.closest('.f_1zif-yant').innerText.match('410933255642572')) {
  554. node.insertAdjacentHTML('afterend', '<span class="arnold_logo" style="position:relative;left:0px; top:-5px; background:#aaa0;display:inline-block; float:right;"><img src="https://i.imgur.com/5giGcsd.png" width="32px" height="32px"></span>');
  555. node.nextSibling.nextSibling.setAttribute('style', 'display:block;color:rgb(50,139,142);background:#181818;border:1px solid rgb(75,138,142);text-align:left;:font-size:10px;margin-right:4px;margin-top:4px;');
  556. }
  557. else if (node.closest('.f_1zif-yant').innerText.match('183831411996004')) {
  558. node.insertAdjacentHTML('afterend', '<span class="corona_logo" style="position:relative;left:0px; top:-5px; background:#aaa0;display:inline-block; float:right;"><img src="https://i.imgur.com/dM1XexF.png" width="32px" height="32px"></span>');
  559. node.nextSibling.nextSibling.setAttribute('style', 'display:block;color:rgb(50,139,142);background:#181818;border:1px solid rgb(75,138,142);text-align:left;:font-size:10px;margin-right:4px;margin-top:4px;');
  560. }
  561. else {
  562. node.insertAdjacentHTML('afterend', '<span class="arnold_logo" style="position:relative;left:0px; top:-5px; background:#aaa0;display:inline-block; float:right;"><img src="https://i.imgur.com/5giGcsd.pnxg" width="32px" height="32px"></span>');
  563. node.nextSibling.nextSibling.setAttribute('style', 'display:block;color:rgb(50,139,142);background:#181818;border:1px solid rgb(75,138,142);text-align:left;:font-size:10px;margin-right:4px;margin-top:4px;');
  564. }
  565. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  566. if (event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].innerText.match(/\.+/)) {
  567. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].style.display = "none";
  568. }
  569. }
  570.  
  571.  
  572. iCapture = event.target.closest('._1dwg._1w_m._q7o');
  573. html2canvas(iCapture, {useCORS: true, backgroundColor: '#222', logging: true, x: wWOffset, y: 440, width: 488}).then(canvas => {
  574. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  575. var iNameGen = Math.random().toString(36).substring(2, 15);
  576. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  577. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  578. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  579. setTimeout(function () {
  580. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  581. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  582. node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: rgb(50,139,142);float: right;border: 1px solid #9990;');
  583. node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Status';
  584. /* Likes Information (Show) */
  585. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  586. }, 0);
  587. })
  588.  
  589. }
  590.  
  591. else if (classCheck0.length && Wwidth<=1444 && window.location.href.match(/(https:\/\/www\.facebook\.com\/photo\.php\?fbid\=\d+\&\D+\.\d+\&\D+\d)/)) {
  592. console.log('Line 522');
  593. if(window.innerWidth == 1440) {wWOffset = window.innerWidth/3-79.0000000000-0.0;}
  594. else if (window.innerWidth == 1402) {wWOffset = window.innerWidth/3-79.0000000000-1.3;}
  595.  
  596. /* Unsupported Resolution Algorithm */
  597. else { alert('Detected an...... innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  598. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  599. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  600. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  601. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  602. }
  603.  
  604. console.log('URL is supported 11/12 by script. 1.15 Version. OK :) :: ' + window.location.href);
  605. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #111!important;"); /* Status Main Background */
  606.  
  607. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#0000; border-radius:10px;"); /* Status Main Context Information */
  608. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #0000; display:block; border:0px solid #111!important;"); /* Status Main Context */
  609.  
  610. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#00ff;");
  611. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  612.  
  613. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  614. node.nextSibling.value = 'Archived Post [Mode: 11]';
  615. node.nextSibling.setAttribute('style','color:#f04;background:#1110;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  616. console.log('Capture: Mode #2');
  617. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  618. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  619. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  620. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  621. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  622. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  623. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  624. }
  625. else {
  626. node.nextSibling.value = 'Archived Post [Mode: 12]';
  627. node.nextSibling.setAttribute('style','color:#0e8;background:#181818;border:1px solid #0e8;text-align:left;:font-size:10px;margin-right:4px;');
  628. if(event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].innerText.match(/\.+/)) {
  629. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].style.display = "none"; }
  630. }
  631.  
  632. iCapture = event.target.closest('._1dwg._1w_m._q7o');
  633. html2canvas(iCapture, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 440, width: 500}).then(canvas => {
  634. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  635. var iNameGen = Math.random().toString(36).substring(2, 15);
  636. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  637. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  638. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  639. setTimeout(function () {
  640. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  641. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  642. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #0e8;float: right;border: 1px solid #9990;');
  643. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base644';
  644. /* Likes Information (Show) */
  645. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  646. }, 0);
  647. })
  648. }
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668. /* Groups */
  669. /* ——————> https://www.facebook.com/?????/?????????/permalink/##########/ */
  670.  
  671. else if (classCheck0.length && Wwidth <= 1440 && window.location.href.match(/(https:\/\/www\.facebook\.com\/\w+\/\w+\/permalink\/\d+)/)) {
  672. console.log('Line 600');
  673. if (window.innerWidth == 1440) { wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0; }
  674. else if (window.innerWidth == 1402) { wWOffset = window.innerWidth / 3 - 79.0000000000 - 1.3; }
  675. else if (window.innerWidth == 1255) { wWOffset = window.innerWidth / 3 - 79.0000000000 - 25.0; } /*(LARGER NUMBER WILL SHIFT THE IMAGE TO THE RIGHT)*/
  676.  
  677. /* Unsupported Resolution Algorithm */
  678. else {
  679. alert('Detected an..... innerWidth of ' + window.innerWidth + '! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  680. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs * 3;
  681. if (OffsetXs => 100) { wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0 - OffsetXs; }
  682. if (OffsetXs <= 0) {
  683. OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  684. wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0 - OffsetXs + OffsetXp;
  685. }
  686. }
  687.  
  688. console.log('URL is supported 13/14 by script. 1.25 Version. OK :) :: ' + window.location.href);
  689. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #111!important;"); /* Status Main Background */
  690.  
  691. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#7774; border-radius:10px;"); /* Status Main Context Information */
  692. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #5554; border-radius:10px; display:block; border:0px solid #111!important;"); /* Status Main Context */
  693.  
  694. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#00ff;");
  695. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  696.  
  697. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  698. node.nextSibling.value = 'Archived Post [Mode: 11]';
  699. node.nextSibling.setAttribute('style', 'color:#004;background:#1110;border:1px solid #004;text-align:left;:font-size:10px;margin-right:4px;');
  700. console.log('Capture: Mode #13');
  701. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style', 'background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  702. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style', 'display:none;');
  703. //event.target.parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(https://i.imgur.com/ZL0LHeL.png); background-size: 38px 16px; background-repeat: no-repeat; display: block; height: 20px; width: 43px; background-position: 0px 0px !important; top: -1px;margin-left:0px;');
  704. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[2].setAttribute("style", "display:none;");
  705. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[2].children[0].children[0].children[0].children[3].setAttribute("style", "display:none;");
  706. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1].children[0].children[0].children[1].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  707. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  708. }
  709. else {
  710. node.nextSibling.value = 'Archived Post [Mode: 14] {Testing}';
  711. node.nextSibling.setAttribute('style', 'color:#0e8;background:#181818;border:1px solid #0e8;text-align:left;:font-size:10px;margin-right:4px;');
  712. if (event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].innerText.match(/\.+/)) {
  713. /////event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].style.display = "none";
  714. }
  715. }
  716.  
  717. iCapture = event.target.closest('._1dwg._1w_m._q7o');
  718. html2canvas(iCapture, { useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 440, width: 500 }).then(canvas => {
  719. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  720. var iNameGen = Math.random().toString(36).substring(2, 15);
  721. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  722. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  723. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  724. setTimeout(function () {
  725. document.querySelector('._5pcp._5lel._2jyu._232_ .r_1zif-zub1 ._5pcq._10is').setAttribute("style", "top:0px;");
  726. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  727. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  728. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style', 'background: #1110;color: #0e8;float: right;border: 1px solid #9990;');
  729. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base64 (Test)';
  730. /* Likes Information (Show) */
  731. //////////event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  732. }, 0);
  733. })
  734. }
  735.  
  736.  
  737. else {
  738. console.log('748 URL is ' + window.location.href); console.log('Capturing statuses on this page is NOT supported! ');
  739. node.setAttribute("style", "color: #700f; border: 1px solid #700f; display:inline-block;");
  740. node.value = 'Unavailable';
  741. }
  742.  
  743.  
  744. }); /* End Line */
  745. })
  746.  
  747.  
  748.  
  749.  
  750. });
  751.  
  752.  
  753. /* — Insert Copy Text Button — */
  754. setMutationHandler({
  755. target: document.querySelector('._3576'),
  756. selector: '.copybtnP',
  757. handler: nodes => nodes.forEach(node => {
  758. node.setAttribute("style", "color:blue; border: 0px solid blue;"); /******/
  759. node.addEventListener('click', function (event) {
  760. var classCheck = document.getElementsByClassName('canvasArea');
  761. //console.log(event.target.parentNode.parentNode.nextSibling.nextSibling.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.className);
  762. //console.log(event.target.closest("._1dwg._1w_m._q7o").childNodes[0].nextSibling.childNodes[0].nextSibling.className);
  763.  
  764. //alert(status_content + ' (Working)');
  765. //alert(event.target.previousSibling.innerText);
  766. if (classCheck.length == 0) {
  767. console.log('classcheck length 0');
  768. getSelection().removeAllRanges();
  769. var status_content1 = event.target.closest('._1dwg._1w_m._q7o').children[1].children[0];
  770. var status_content2 = event.target.closest('._1dwg._1w_m._q7o').children[1].children[1];
  771. var range1 = document.createRange();
  772. var range2 = document.createRange();
  773. range1.selectNode(status_content1);
  774. range2.selectNode(status_content2);
  775. window.getSelection().addRange(range1);
  776. window.getSelection().addRange(range2);
  777. }
  778. ///////////////////////////////////
  779. if (classCheck.length == 1) {
  780. console.log('classcheck length 1');
  781. getSelection().removeAllRanges();
  782. //console.log(event.target.className);
  783. var status_content0 = event.target.parentNode.childNodes[3];
  784. //status_content1 = event.target.parentNode.children[0];
  785. //status_content2 = event.target.closest('._1dwg._1w_m._q7o').children[1].children[1];
  786.  
  787. //Base64 -- event.target.parentNode.children[3]
  788. var range0 = document.createRange();
  789. //range1 = document.createRange();
  790. //range2 = document.createRange();
  791. range0.selectNode(status_content0);
  792. //range1.selectNode(status_content1);
  793. //range2.selectNode(status_content2);
  794. window.getSelection().addRange(range0);
  795. //window.getSelection().addRange(range1);
  796. //window.getSelection().addRange(range2);
  797. }
  798.  
  799. try {
  800. var successful = document.execCommand('copy');
  801. var msg = successful ? 'successful' : 'unsuccessful';
  802. //console.log('Copying text command was ' + msg);
  803. } catch (err) {
  804. console.log('Oops, unable to copy');
  805. }
  806. return false;
  807. })
  808. })
  809. });
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840. /* — Gather Status Information — */
  841. var nodeCount = 0;
  842. var NumIncr = 0;
  843. setMutationHandler({
  844.  
  845. target: document.querySelector('._3576'),
  846. selector: '._5pcq',
  847. processExisting: false,
  848. handler: nodes => nodes.forEach(node => {
  849. /*._5pcq*/ node.setAttribute("style", "font-size:10.5px;letter-spacing:1px;color:#000;");
  850. nodeCount++; /* ———---> */ console.log('Amount of Nodes' + nodeCount);
  851.  
  852. /* Delay Script */
  853. setTimeout(function () {
  854. if (!node.parentNode.innerHTML.match(/copybtnP"|s2img"/)) {
  855. /*uncomment-to-enable/* Node Counter console.log('(' + NumIncr++ + ') ' + node.innerText); */
  856. var PosterName = 'Posted By: '+node.closest('._6a._5u5j._6b').children[0].innerText;
  857. var PostInformation = node.innerText;
  858. var PostCategory = document.getElementsByClassName('_5pcq')[1].parentNode.innerText.replace(' · ','');
  859. var PostContent = node.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.innerText;
  860. if(!PostCategory) {console.log(PosterName+'\n'+PostInformation+'\n\n'+PostContent)}
  861. else {console.log(PosterName+'\n'+PostInformation+'\n\n'+PostContent+'\n\nPost Category: ['+PostCategory+']')} // Next Next Next Update
  862. //console.log('node is'+node.className);
  863. if(!node.parentNode.innerHTML.match(/copybtnP"|s2img"/)) {
  864. node.insertAdjacentHTML('afterend', '<input type="button" class="copybtnP" name="copyp" value="Copy Text"/>');
  865. node.insertAdjacentHTML('afterend', '<br><input type="button" class="s2img" name="s2img" value="Export Status"/>');}
  866. }
  867. }, 0);
  868. })
  869.  
  870. });
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925. setMutationHandler({
  926. target: document.querySelector('.fbPhotosPhotoCaption'),
  927. selector: '.hasCaption',
  928. handler: nodes => nodes.forEach(node => {
  929. node.style.color = '#f00';
  930. var PhotoCaption = document.getElementsByClassName('hasCaption')[0];
  931. console.log('Current Image: ' + PhotoCaption.innerText);
  932. if (!document.getElementsByClassName('fbPhotosPhotoCaption')[0].innerHTML.includes('copybtn"')) {
  933. PhotoCaption.insertAdjacentHTML('afterend', '<input type="button" class="copybtn" name="copy" value="Copy"/>');
  934. }
  935. var copyTextareaBtn = document.querySelector('.copybtn');
  936. copyTextareaBtn.addEventListener('click', function (event) {
  937. var copy_text = document.getElementsByClassName("hasCaption")[0];
  938. var range = document.createRange();
  939. range.selectNode(copy_text);
  940. window.getSelection().addRange(range);
  941. try {
  942. var successful = document.execCommand('copy');
  943. var msg = successful ? 'successful' : 'unsuccessful';
  944. console.log('Copying text command was ' + msg);
  945. } catch (err) {
  946. console.log('Oops, unable to copy');
  947. }
  948. });
  949. })
  950. });
  951.  
  952. function pad(n, width, z) {
  953. z = z || '0';
  954. n = n + '';
  955. return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
  956. }
  957.  
  958. function expandDates(e) {
  959. for (var t, a = 0; t = e[a++];) t.querySelector(".full-timestamp") || t.insertAdjacentHTML("beforeend", '<span class="full-timestamp"> on ' + moment(new Date(1e3 * t.dataset.utime)).format("l \\at LTS"))
  960. }
  961.  
  962. function RecentTimestamps(e) {
  963. for (var t, n = 0; t = e[n++];)
  964. if (!t.querySelector(".full-timestamp")) {
  965. if (1 == t.innerText.includes("min")) {
  966. var a = t.innerText.match(/[0-9]{1,2}/),
  967. s = parseInt(a, 10);
  968. t.insertAdjacentHTML("beforeend", '<span class="full-timestamp"> <span style="color:#365899">(' + moment(new Date).subtract(s, "minutes").format("h:mm:ss A") + ' ≃ <span style="color:#365899">ᴀᴘᴘʀᴏxɪᴍᴀᴛᴇ)</span><br>')
  969. }
  970. if (1 == t.innerText.includes("hr")) {
  971. var r = t.innerText.match(/[0-9]{1,2}/),
  972. m = parseInt(r, 10),
  973. o = 10 * parseInt(moment(new Date).format("mm") / 10, 10),
  974. l = 10 * parseInt(moment(new Date).format("ss") / 10, 10);
  975. t.insertAdjacentHTML("beforeend", '<span class="full-timestamp"> <span style="color:#365899">on ' + moment(new Date).subtract(m, "hours").format("l \\at h:") + pad(o, 2) + ":" + pad(l, 2) + '<span style="color:#365899"> ≃ (ᴀᴘᴘʀᴏxɪᴍᴀᴛᴇ)</span><br>')
  976. }
  977. }
  978. }
  979.  
  980. function RecentPostURLs(e) {
  981. if (e.parentNode) {
  982. for (var a = 0; a < e.length; a++) {
  983. var r = e[a];
  984. !1 === r.innerHTML.includes("<br>") && "_5r69" != r.className && (r.getElement, r.insertAdjacentHTML("afterend", '<br><span style="color:#9c9dc3">' + r.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.href.replace(/\?fref=nf/, "").replace("&__tn__=", "").replace("&__tn__=m-R", "").replace("7%2Cdm-R-R", "").replace("%2Cdm-R-R", "").replace(/&eid=.+/, "").replace(/xts/, "").match(/facebook.com\/[a-z|A-Z|[0-9|\-|_|.]+.[a-zA-Z|[0-9|\-|_|.|]+[a-zA-Z|[0-9|\-|_|.|?=]+/) + "</span>"))
  985. }
  986. }
  987. }
  988.  
  989. function ExternalURLs(e) {
  990. for (var n = 0; n < e.length; n++) {
  991. var r = e[n],
  992. a = r.href.replace(/https:\/\/l\.facebook.com\/l.php\?u=/, "");
  993. !1 === r.innerHTML.includes("<br>") && "_5r69" != r.className && r.insertAdjacentHTML("afterend", '<span class="externalURLs">' + decodeURIComponent(a.replace(/\+/g, " ")).replace(/.fbclid=[\D}\d]+/, "").slice(0, 256) + "</span>")
  994. }
  995. }
  996.  
  997. function expandPostIDs(e) {
  998. for (var r = 0; r < e.length; r++)
  999. {
  1000. var p = e[r];
  1001. !1 === p.innerHTML.includes("<br>") && "_5pcq" === p.className && p.insertAdjacentHTML("beforeend", "<br>" + p.href.replace(/&__xts__%.+/, "").replace(/(\?__xts__%.+|\/\?type=\d&__xts__%.+)/gm, "").replace("permalink.php?", "&nbsp;permalink.php?").replace("/?type=3", "").replace("/groups/", "Group: ").replace("/permalink/", "<br>Post ID: ").slice(24, 100).replace("/", ""))
  1002. /* LINK SANITATIZATION */ p.href = p.href.replace(/(\/\?\S+|\?\S+)/,'');
  1003.  
  1004. /*Hide Public Globe Icon */ setTimeout(function(){ /*alert(e[2].attributes[1].value == "Public"); */ }, 0);
  1005. if( !e[2].parentNode.innerHTML.includes("<span style=\"color:#0b0;\">Public</span>") && window.location.href.match(/\S+\/\d+/) )
  1006. { /* This condition repeats itself twice for whatever reason */
  1007. e[2].insertAdjacentHTML("afterend", "<span style=\"color:#0b0;\">Public</span>");
  1008. setTimeout(function(){ e[2].setAttribute('style','display:none'); }, 0);
  1009. if(e.length >1){e[2].nextSibling.nextSibling.remove;}
  1010. }
  1011. }
  1012. }