FB: Post Tools & Statistics

Shows exact timestamps and post information on Facebook Posts.

目前为 2019-11-02 提交的版本,查看 最新版本

  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.23
  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. GM_addStyle('._2yq ._4-u2::before {border:0px solid #2220;}'+
  26. 'a._5pcq:hover {text-decoration: none!important;}'+
  27. 'a._5ptz:hover {text-decoration: none;}'+
  28. '.h_1zif-zjsf {color: red;}'+
  29. '.full-timestamp { opacity: 0.95; color: #f00!important; }'+
  30. '.full-timestamp:hover { opacity: 1.0; }'+
  31. '.full-timestamp:before { content: ""; }'+
  32. '.full-timestamp:after { content: ""; }'+
  33. '.timestampContent { display: none; }'+
  34. '._5ptz.timestamp.livetimestamp .timestampContent { display: inline-block; }'+
  35. '._5pcp._5lel._2jyu._232_ {line-height: 16px;font-size:9px;}' /* Status Information Spacing */+
  36. '.sponsored { color: #06b;}' + '.copybtnP { margin-bottom: 8px }'+
  37. '.copybtnP, .s2img {display: inline-block;}'+
  38. '.s2img {margin-right:4px;}'+
  39. '._3ds9 {border: 1px dashed #385898 !important; border-radius: 1px; padding-bottom: 0px !important; margin-bottom: 8px !important; background: #38589811;}'+
  40. '.copybtn, .copybtnP, .s2img { border: 1px solid #e2e4e5; background: #0000; color: #365899; border-radius: 8px; letter-spacing: 0.05px;font-weight: 700;height: 23px;}'+
  41. '.canvasArea {height: 23px;overflow: hidden;color: #c1c1c1;word-break: break-all;display: block;font-size: 10px;letter-spacing: -0.70px;font-family: "Segoe UI" !important;line-height: 11px;text-align: justify;margin-top: 5px;margin-bottom: 1px;background: #00000010;border-radius: 10px;border: 1px dashed #c1c1c1;margin-top: 5px;padding-bottom: 0px;padding-left: 1px;padding-right: 1px;}'+
  42. 'span.SaveAsImageFile a { border:0px solid red; position:relative; font-weight:600; color:#aaa;font-family: \'Segoe UI\';font-variant-caps: all-small-caps;}'+
  43. 'div._3ekx._29_4 div._6m3._--6 div._59tj._2iau { top: 7px !important;position: relative;}'+
  44. 'span.externalURLs { position: absolute;color: #606770;padding-left: 2px;display: inline-block;top: 2px;width: 489px;height:11px;line-height:10px;font-size: 10px;border-radius: 3px;background: #f2f32300;left: 3px;white-space: pre;text-overflow: ellipsis;overflow: hidden;border: 1px dashed #bec3c900;}'+
  45. 'span.ViewImage { color: #888 !important; font-family: \'Segoe UI\';font-variant-caps: all-small-caps;}'+
  46. 'span.ViewImage a { color: #888 !important; font-family: \'Segoe UI\';font-variant-caps: all-small-caps;}');
  47. // process the already loaded portion of the page if any
  48. expandDates(document.querySelectorAll('abbr[data-utime]'));
  49. RecentTimestamps(document.querySelectorAll('.q_1zif-zjsq'));
  50. RecentPostURLs(document.querySelectorAll('.q_1zif-zjsq, ._5r69, ._6ks'));
  51. ExternalURLs(document.querySelectorAll('._52c6'));
  52. expandPostIDs(document.querySelectorAll('._5pcq'));
  53. document.querySelectorAll('.hasCaption');
  54. // process the stuff added from now on
  55. setMutationHandler(document, 'abbr[data-utime]', expandDates);
  56. setMutationHandler(document, '.q_1zif-zjsq', RecentTimestamps);
  57. setMutationHandler(document, '.q_1zif-zjsq, ._5r69, ._6ks', RecentPostURLs);
  58. setMutationHandler(document, '._52c6', ExternalURLs);
  59. setMutationHandler(document, '._5pcq', expandPostIDs);
  60. /*
  61. html2canvas(document.querySelector('._3576')).then(canvas => {
  62. document.getElementsByClassName('s2img')[0].addEventListener('click', function(event) {node.insertAdjacentHTML('afterend', canvas.toDataURL());})
  63. });
  64. */
  65. setMutationHandler({
  66. target: document.querySelector('._3576'),
  67. selector: '.s2img',
  68. handler: nodes => nodes.forEach(node => {
  69. var Wwidth = window.innerWidth;
  70. var Wheight = window.innerHeight;
  71. node.setAttribute("style", "color: red; border: 1px solid red;");
  72. node.addEventListener('click', function (event) {
  73. //node.closest('._5pcp._5lel').setAttribute("style", "font-size: 7px;line-height: 16px;");
  74. node.setAttribute("style", "color: #5550; border: 1px solid #0000; display:none;");
  75. node.nextSibling.setAttribute("style", "color: #00ff; border: 1px solid #00ff; display:inline-block;");
  76. var PageTitleColorPROMPT = '#fff';
  77. //console.log(event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className);
  78. //event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("style", "background:#222;");
  79. //var PageTitleColorPROMPT = prompt('Enter the HTML Hex Color # the Page Title should be:','#fff');
  80. /* Name of Page Color Change on Click */
  81. /* Likes Information (Hide/Show) */
  82. var classCheck0 = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.children;
  83. var classCheck1 = event.target.parentNode.children;
  84. var classCheck2 = event.target.parentNode;
  85.  
  86.  
  87. if (classCheck0.length >= 0 && Wwidth<=1440 && window.location.href.match(/(https:\/\/www\.facebook\.com\/(\w+)\/posts\/\d+\?)/)) {
  88.  
  89. var wWOffset;
  90. if(window.innerWidth == 1440) {wWOffset = 401;}
  91. else if (window.innerWidth == 1402) {wWOffset = 441;}
  92.  
  93. /* Unsupported Resolution Algorithm */
  94. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  95. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  96. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  97. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  98. wWOffset = window.innerWidth/3-123.000000000-0.0-OffsetXs+OffsetXp; }
  99. }
  100.  
  101. console.log('URL is supported 0/1 by script. 1.04 Version. OK :) :: ' + window.location.href);
  102.  
  103. event.target.parentNode.setAttribute("style", "background:#222;");
  104. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #111!important;");
  105. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #111!important;");
  106. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#ff0f;");
  107. 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;");
  108. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  109. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#111;");
  110.  
  111. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  112. node.nextSibling.value = 'Archived Post [Mode: 0]';
  113. node.nextSibling.setAttribute('style','color:#f04;background:#11a0;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  114. console.log('Capture: Mode #2');
  115. //document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  116. //document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  117. 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;');
  118. //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;");
  119. //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;");
  120. 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;
  121. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  122. }
  123. else {
  124. node.nextSibling.value = 'Archived Post [Mode: 1]';
  125. node.nextSibling.setAttribute('style','color:#f04;background:#1fcf;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  126. console.log('Capture: Mode #1');
  127. }
  128.  
  129. var iCapture = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode;
  130. html2canvas(iCapture, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 425, width: 510}).then(canvas => {
  131.  
  132. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  133. var iNameGen = Math.random().toString(36).substring(2, 15);
  134. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  135. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  136. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  137. setTimeout(function () {
  138. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  139. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  140. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #111f;color: #f68;float: right;border: 1px solid #9990;');
  141. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base641';
  142. /* Likes Information (Show) */
  143. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  144. }, 0);
  145. })
  146. }
  147.  
  148.  
  149.  
  150. else if (classCheck0.length >= 0 && window.innerWidth <= 1440 && window.location.href.match(/(facebook\.com\/(\D+|\D+\d+)\/photos\/a.\d{1,45}\/\d{1,26}.+)/)) {
  151.  
  152. console.log('URL is supported by Mode(s) 2/3. — Script Version 1.18 — OK :) :: ' + window.location.href);
  153.  
  154. if(window.innerWidth == 1440) {wWOffset = 401;}
  155. else if (window.innerWidth == 1402) {wWOffset = 382;}
  156.  
  157. /* Unsupported Resolution Algorithm */
  158. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  159. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  160. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  161. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  162. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  163. }
  164.  
  165.  
  166.  
  167. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  168.  
  169. ///////event.target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("style","background:red;");
  170. ///////event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:green;");
  171. ///////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;");
  172.  
  173. 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 */
  174. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #0000; display:block; border:0px solid #111!important;"); /* Status Wrapper for Main Context Information */
  175. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#222; border-radius:10px;"); /* Status Main Context Information*/
  176.  
  177. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  178. // event.target.closest('._4-u2').setAttribute("style", "background:#00f0;");
  179. node.nextSibling.value = 'Archived Post [Mode: 2]';
  180. // node.nextSibling.setAttribute('style','color:#0f4;background:#1110;border:1px solid #0f4;text-align:left;:font-size:10px;');
  181.  
  182. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  183. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  184. //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;');
  185. 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;");
  186. 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;");
  187.  
  188. 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;
  189. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  190. }
  191.  
  192. else {
  193. //NotNeeded//event.target.closest('._4-u2').setAttribute("style", "background:#f00f;");
  194. node.nextSibling.value = 'Archived Post [Mode: 3]';
  195. node.nextSibling.setAttribute('style','color:#40f;background:#111;border:1px solid #40f;text-align:left;:font-size:10px;'); /* Archived Post Label */
  196. }
  197.  
  198. //if(!window.location.href.match(/\d/)) {};
  199. //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;");
  200. //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;");
  201. var iCaptureM3 = event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode;
  202. //setTimeout(function () {
  203. html2canvas(iCaptureM3, {useCORS: true, backgroundColor: '#222', logging: true, x: wWOffset, y: 425, width: 510}).then(canvas => {
  204. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  205. var iNameGen = Math.random().toString(36).substring(2, 15);
  206. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  207. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  208. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  209. setTimeout(function () {
  210. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  211. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  212. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  213. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base645';
  214. /* Likes Information (Show) */
  215. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  216. }, 0);
  217. });
  218. //}, 100);
  219. }
  220.  
  221.  
  222. 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+/)) {
  223.  
  224. console.log('URL is supported by Mode(s) 4/5. — Script Version 1.11 — OK :) :: ' + window.location.href);
  225.  
  226. if(window.innerWidth == 1440) {wWOffset = 401;}
  227. else if (window.innerWidth == 1402) {wWOffset = 371;}
  228. /* Unsupported Resolution Algorithm */
  229. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  230. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  231. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  232. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  233. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  234. }
  235.  
  236. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined && window.location.href.match(/Elted/)) {
  237. var iCaptureM4 = event.target.closest('._4-u2');
  238. node.nextSibling.value = 'Archived Post [Mode: 4]';
  239. event.target.parentNode.setAttribute("style", "background:#111;");
  240. event.target.closest('._1dwg._1w_m._q7o').nextSibling.setAttribute("style","display:none;");
  241.  
  242. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  243. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  244. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  245. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #222; display:block; border:0px solid #222!important;");
  246. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  247. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  248. 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;");
  249. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  250. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#111;");
  251. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:#111;");
  252. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:#111;");
  253. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:#111;");
  254. node.nextSibling.setAttribute('style','color:#45d;background:#1110;border:1px solid #45d;text-align:left;:font-size:10px;');
  255.  
  256. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  257. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  258. //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;');
  259. //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;");
  260. //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;");
  261. //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;
  262. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  263. html2canvas(iCaptureM4, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 65, width: 509}).then(canvas => {
  264. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  265. var iNameGen = Math.random().toString(36).substring(2, 15);
  266. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  267. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  268. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  269. setTimeout(function () {
  270. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  271. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  272. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #2220;color: #86f;float: right;border: 1px solid #9990;');
  273. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base6411';
  274. /* Likes Information (Show) */
  275. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  276. }, 0);
  277. });
  278. }
  279.  
  280. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] == undefined) {
  281.  
  282. if(window.innerWidth == 1440) {wWOffset = 401;}
  283. else if (window.innerWidth == 1402) {wWOffset = 388;}
  284. /* Unsupported Resolution Algorithm */
  285. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  286. 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;
  287. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  288. if (OffsetXs <= 0) { var OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  289. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  290. }
  291.  
  292. iCaptureM5 = event.target.closest('._1dwg._1w_m._q7o');
  293. node.nextSibling.value = 'Archived Post [Mode: 5]';
  294. event.target.parentNode.setAttribute("style", "background:#222;");
  295. event.target.closest('._1dwg._1w_m._q7o').nextSibling.setAttribute("style","display:none;");
  296. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  297. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  298. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  299. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  300. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  301. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  302. 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;");
  303. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  304. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#111;");
  305. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:#111;");
  306. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:#111;");
  307. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:#111;");
  308. node.nextSibling.setAttribute('style','color:#29d;background:#1110;border:1px solid #29d;text-align:left;:font-size:10px;');
  309.  
  310. html2canvas(iCaptureM5, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 425, width: 500}).then(canvas => {
  311. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  312. var iNameGen = Math.random().toString(36).substring(2, 15);
  313. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  314. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  315. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  316. setTimeout(function () {
  317. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  318. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  319. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  320. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base642';
  321. /* Likes Information (Show) */
  322. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  323. }, 0);
  324. });
  325. }
  326.  
  327. else {
  328. if(window.innerWidth == 1440) {wWOffset = 401;}
  329. else if (window.innerWidth == 1402) {wWOffset = 381;}
  330. /* Unsupported Resolution Algorithm */
  331. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  332. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  333. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  334. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  335. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  336. }
  337.  
  338. node.nextSibling.value = 'Archived Post [Mode: 6]';
  339. event.target.parentNode.parentNode.setAttribute("style", "background:#111;");
  340. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  341. node.nextSibling.setAttribute('style','color:#29d;background:#1110;border:1px solid #29d;text-align:left;:font-size:10px;');
  342.  
  343. var iCaptureM6 = event.target.closest('._1dwg._1w_m._q7o');
  344. html2canvas(iCaptureM6, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 425, width: 509}).then(canvas => {
  345. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  346. var iNameGen = Math.random().toString(36).substring(2, 15);
  347. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  348. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  349. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  350. setTimeout(function ()
  351. {
  352. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  353. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  354. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  355. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base640';
  356. /* 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;");
  357. }, 0);
  358. });
  359. }
  360.  
  361. event.target.closest('._5pcr.userContentWrapper').children[1].setAttribute("style", "display:none;");
  362. event.target.parentNode.setAttribute("style", "background:#222;");
  363. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  364. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  365. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  366. 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;");
  367. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  368. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#111;");
  369. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:#111;");
  370. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:#111;");
  371. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:#111;");
  372.  
  373.  
  374. }
  375.  
  376.  
  377. else if (classCheck0.length >= 0 && window.innerWidth <= 1440 && window.location.href.match(/facebook.com\/.+\w+\/posts\/\d+|facebook\.com\/(\D+|\D+\d+)\/posts\/\d+/)) {
  378.  
  379. console.log('URL is supported by Mode(s) 7/8. — Script Version 1.18 — OK :) :: ' + window.location.href);
  380.  
  381. if(window.innerWidth == 1440) {wWOffset = 401;}
  382. else if (window.innerWidth == 1402) {wWOffset = 382;}
  383. /* Unsupported Resolution Algorithm */
  384. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  385. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  386. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  387. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  388. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  389. }
  390.  
  391. event.target.closest('._5pcr.userContentWrapper').children[1].setAttribute("style", "display:none;");
  392. event.target.parentNode.setAttribute("style", "background:#111;");
  393. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  394. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').parentNode.parentNode.setAttribute("style", "color: #fff; background: #111; display:block; border:0px solid #222!important;");
  395. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#0000;");
  396. 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;");
  397. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  398. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#111;");
  399. event.target.closest('._5pcr.userContentWrapper').setAttribute("style", "background:#111;");
  400. event.target.closest('._5pcr.userContentWrapper').parentNode.setAttribute("style", "background:#111;");
  401. event.target.closest('._5pcr.userContentWrapper').parentNode.parentNode.setAttribute("style", "background:#111;");
  402.  
  403. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  404. node.nextSibling.value = 'Archived Post [Mode: 7]';
  405. node.nextSibling.setAttribute('style','color:#45d;background:#1110;border:1px solid #45d;text-align:left;:font-size:10px;');
  406.  
  407. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  408. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  409. //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;');
  410. ////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;");
  411. ////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;");
  412. 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;
  413. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  414. } 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;'); }
  415.  
  416. //var iCaptureM5 = event.target.closest('._4-u2');
  417. var iCaptureM5 = event.target.closest('._1dwg._1w_m._q7o');
  418.  
  419.  
  420. html2canvas(iCaptureM5, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 425, width: 510}).then(canvas => {
  421. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  422. var iNameGen = Math.random().toString(36).substring(2, 15);
  423. event.target.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  424. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  425. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  426. setTimeout(function () {
  427. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  428. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  429. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #86f;float: right;border: 1px solid #9990;');
  430. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base643';
  431. /* Likes Information (Show) */
  432. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  433. }, 0);
  434. });
  435.  
  436. }
  437.  
  438.  
  439. else if (!classCheck2.length && Wwidth<=1920 && window.location.href.match(/(https:\/\/www\.facebook\.com\/\w+\/\d+\/permalink\/\d+\/)/)) {
  440.  
  441.  
  442. function minusPercent(n,p) {return n - (n * (p/100));}
  443. /* <— (Subtraction) */
  444. /* 200 pixels increase = subtract 33.25 */
  445. /* 1 pixel increase = subtract 0.16625 */
  446. var w1920 = -8.5;
  447. var w1725 = 23.689;
  448. var w1600 = 44.70;
  449. var w1542 = 54.3425;
  450. var w1500 = 61.325;
  451. var w1450 = 69.6375;
  452. var w1400 = 77.95;
  453. var w1200 = 111.20;
  454. var w1172 = 115.63;
  455. /* —> (Addition) */
  456.  
  457.  
  458. if (window.innerWidth == 1920) {wWOffset = window.innerWidth / 3 - w1920;}
  459. else if (window.innerWidth == 1725) {wWOffset = window.innerWidth / 3 - w1725;}
  460. else if (window.innerWidth == 1600) {wWOffset = window.innerWidth / 3 - w1600;}
  461. else if (window.innerWidth == 1500) {wWOffset = window.innerWidth / 3 - w1500;}
  462. else if (window.innerWidth == 1542) {wWOffset = window.innerWidth / 3 - w1542;}
  463. else if (window.innerWidth == 1450) {wWOffset = window.innerWidth / 3 - w1450;}
  464. else if (window.innerWidth == 1400) {wWOffset = window.innerWidth / 3 - w1400;}
  465. else if (window.innerWidth == 1200) {wWOffset = window.innerWidth / 3 - w1200;}
  466. else if (window.innerWidth == 1172) {wWOffset = window.innerWidth / 3 - w1172;}
  467.  
  468. /* Unsupported Resolution Algorithm */
  469. else {
  470. alert('Detected an innerWidth of ' + window.innerWidth + '! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  471. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).');
  472. OffsetXs = OffsetXs * 3;
  473. if (OffsetXs => 100) {
  474. wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0 - OffsetXs;
  475. }
  476. if (OffsetXs <= 0) {
  477. OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  478. wWOffset = window.innerWidth / 3 - 79.0000000000 - 0.0 - OffsetXs + OffsetXp;
  479. }
  480. }
  481.  
  482. console.log('URL is supported 9/10 by script. 1.20 Version. OK :) :: ' + window.location.href);
  483. 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 */
  484. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#0000; border-radius:10px;"); /* Status Main Context Information */
  485. //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 */
  486. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#00ff;");
  487. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  488.  
  489. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  490. node.nextSibling.value = 'Archived Post [Mode: 9]';
  491. node.nextSibling.setAttribute('style', 'color:#f04;background:#1110;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  492. console.log('Capture: Mode #2');
  493. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style', 'background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  494. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style', 'display:none;');
  495. 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;");
  496. 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;");
  497. 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;
  498. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  499. }
  500. else {
  501. node.nextSibling.value = 'Archived Post [Mode: 10]';
  502. /*Software Used:*/
  503. if (node.closest('.f_1zif-yant').innerText.match('410933255642572')) {
  504. 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>');
  505. 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;');
  506. }
  507. else if (node.closest('.f_1zif-yant').innerText.match('183831411996004')) {
  508. 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>');
  509. 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;');
  510. }
  511. else {
  512. 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>');
  513. 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;');
  514. }
  515. //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;');
  516. if (event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].innerText.match(/\.+/)) {
  517. //event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].style.display = "none";
  518. }
  519. }
  520.  
  521.  
  522. iCapture = event.target.closest('._1dwg._1w_m._q7o');
  523. html2canvas(iCapture, {useCORS: true, backgroundColor: '#222', logging: true, x: wWOffset, y: 440, width: 488}).then(canvas => {
  524. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  525. var iNameGen = Math.random().toString(36).substring(2, 15);
  526. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  527. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  528. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  529. setTimeout(function () {
  530. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  531. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  532. node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: rgb(50,139,142);float: right;border: 1px solid #9990;');
  533. node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Status';
  534. /* Likes Information (Show) */
  535. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  536. }, 0);
  537. })
  538.  
  539. }
  540.  
  541. else if (classCheck0.length && Wwidth<=1440 && window.location.href.match(/(https:\/\/www\.facebook\.com\/photo\.php\?fbid\=\d+\&\D+\.\d+\&\D+\d)/)) {
  542.  
  543. if(window.innerWidth == 1440) {wWOffset = window.innerWidth/3-79.0000000000-0.0;}
  544. else if (window.innerWidth == 1402) {wWOffset = window.innerWidth/3-79.0000000000-1.3;}
  545.  
  546. /* Unsupported Resolution Algorithm */
  547. else { alert('Detected an innerWidth of '+window.innerWidth+'! Script hasn\'t been optmized for use with this resolution. Screenshot will be off center.');
  548. OffsetXs = prompt('Enter a number from 1 to 100 to shift the image to the right. (Screenshot Offset - Subtract X Axis).'); OffsetXs = OffsetXs*3;
  549. if (OffsetXs => 100) {wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs;}
  550. if (OffsetXs <= 0) { OffsetXp = prompt('Enter a number from 1 to 100 to shift the image to the left. (Screenshot Offset - Add X Axis');
  551. wWOffset = window.innerWidth/3-79.0000000000-0.0-OffsetXs+OffsetXp; }
  552. }
  553.  
  554. console.log('URL is supported 11/12 by script. 1.15 Version. OK :) :: ' + window.location.href);
  555. 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 */
  556.  
  557. event.target.closest('.n_1zif-ycce.h_1zif-v9xd').setAttribute("style", "background:#0000; border-radius:10px;"); /* Status Main Context Information */
  558. 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 */
  559.  
  560. //event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:block; background:#00ff;");
  561. event.target.closest('.u_1zif-yanm').children[0].children[0].children[1].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  562.  
  563. if (document.querySelector('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.nextSibling.children[1] !== undefined) {
  564. node.nextSibling.value = 'Archived Post [Mode: 11]';
  565. node.nextSibling.setAttribute('style','color:#f04;background:#1110;border:1px solid #f04;text-align:left;:font-size:10px;margin-right:4px;');
  566. console.log('Capture: Mode #2');
  567. document.querySelector('.s2img').parentNode.parentNode.nextSibling.nextSibling.firstChild.setAttribute('style','background-image: url(/rsrc.php/v3/yX/r/OvSbQLwa0TM.png);');
  568. document.querySelector('.s2img').parentNode.parentNode.nextSibling.setAttribute('style','display:none;');
  569. //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;');
  570. 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;");
  571. 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;");
  572. 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;
  573. event.target.parentNode.parentNode.parentNode.parentNode.children[0].children[0].children[0].children[0].children[0].style.color = PageTitleColorPROMPT;
  574. }
  575. else {
  576. node.nextSibling.value = 'Archived Post [Mode: 12]';
  577. node.nextSibling.setAttribute('style','color:#0e8;background:#181818;border:1px solid #0e8;text-align:left;:font-size:10px;margin-right:4px;');
  578. if(event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].innerText.match(/\.+/)) {
  579. event.target.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.children[0].style.display = "none"; }
  580. }
  581.  
  582. iCapture = event.target.closest('._1dwg._1w_m._q7o');
  583. html2canvas(iCapture, {useCORS: true, backgroundColor: '#111', logging: true, x: wWOffset, y: 440, width: 500}).then(canvas => {
  584. var a = canvas.toDataURL("image/jpg").replace("image/jpg", "image/octet-stream");
  585. var iNameGen = Math.random().toString(36).substring(2, 15);
  586. node.insertAdjacentHTML('afterend', '<span class="SaveAsImageFile"><a href="' + a + '" download="' + iNameGen + '.jpg">Save As Image File</a></span>');
  587. node.insertAdjacentHTML('afterend', '<span class="ViewImage"><a href="' + a + '" target="_blank">View Image</a> / </span>');
  588. node.insertAdjacentHTML('afterend', '<div class="canvasArea">' + canvas.toDataURL("image/jpg") + '</div>');
  589. setTimeout(function () {
  590. node.setAttribute("style", "color: red; border: 1px solid red; display:none;");
  591. node.nextSibling.nextSibling.setAttribute("style", "color: red;");
  592. node.nextSibling.nextSibling.nextSibling.nextSibling.setAttribute('style','background: #1110;color: #0e8;float: right;border: 1px solid #9990;');
  593. node.nextSibling.nextSibling.nextSibling.nextSibling.value = 'Copy Base644';
  594. /* Likes Information (Show) */
  595. event.target.closest('._1dwg._1w_m._q7o').nextSibling.childNodes[0].childNodes[4].childNodes[0].nextSibling.childNodes[0].setAttribute("style", "display:none;background:#0f0;");
  596. }, 0);
  597. })
  598. }
  599.  
  600.  
  601.  
  602. else {
  603. console.log('URL is ' + window.location.href); console.log('Capturing statuses on this page is NOT supported! ');
  604. node.setAttribute("style", "color: #700f; border: 1px solid #700f; display:inline-block;");
  605. node.value = 'Unavailable';
  606. }
  607.  
  608.  
  609. });
  610. })
  611.  
  612.  
  613.  
  614.  
  615. });
  616.  
  617. /* — Insert Copy Text Button — */
  618. setMutationHandler({
  619. target: document.querySelector('._3576'),
  620. selector: '.copybtnP',
  621. handler: nodes => nodes.forEach(node => {
  622. node.setAttribute("style", "color:blue; border: 1px solid blue;");
  623. node.addEventListener('click', function (event) {
  624. var classCheck = document.getElementsByClassName('canvasArea');
  625. //console.log(event.target.parentNode.parentNode.nextSibling.nextSibling.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.className);
  626. //console.log(event.target.closest("._1dwg._1w_m._q7o").childNodes[0].nextSibling.childNodes[0].nextSibling.className);
  627.  
  628. //alert(status_content + ' (Working)');
  629. //alert(event.target.previousSibling.innerText);
  630. if (classCheck.length == 0) {
  631. getSelection().removeAllRanges();
  632. var status_content1 = event.target.closest('._1dwg._1w_m._q7o').children[1].children[0];
  633. var status_content2 = event.target.closest('._1dwg._1w_m._q7o').children[1].children[1];
  634. var range1 = document.createRange();
  635. var range2 = document.createRange();
  636. range1.selectNode(status_content1);
  637. range2.selectNode(status_content2);
  638. window.getSelection().addRange(range1);
  639. window.getSelection().addRange(range2);
  640. }
  641. if (classCheck.length == 1) {
  642. getSelection().removeAllRanges();
  643. var status_content0 = event.target.closest('._5pcp._5lel._2jyu._232_').previousSibling;
  644. status_content1 = event.target.parentNode.children[0];
  645. status_content2 = event.target.closest('._1dwg._1w_m._q7o').children[1].children[1];
  646.  
  647. //Base64 -- event.target.parentNode.children[3]
  648. var range0 = document.createRange();
  649. range1 = document.createRange();
  650. range2 = document.createRange();
  651. range0.selectNode(status_content0);
  652. range1.selectNode(status_content1);
  653. range2.selectNode(status_content2);
  654. window.getSelection().addRange(range0);
  655. window.getSelection().addRange(range1);
  656. window.getSelection().addRange(range2);
  657. }
  658.  
  659. try {
  660. var successful = document.execCommand('copy');
  661. var msg = successful ? 'successful' : 'unsuccessful';
  662. //console.log('Copying text command was ' + msg);
  663. } catch (err) {
  664. console.log('Oops, unable to copy');
  665. }
  666. return false;
  667. })
  668. })
  669. });
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700. /* — Gather Status Information — */
  701. var nodeCount = 0;
  702. var NumIncr = 0;
  703. setMutationHandler({
  704. target: document.querySelector('._3576'),
  705. selector: '._5pcq',
  706. processExisting: false,
  707. handler: nodes => nodes.forEach(node => {
  708. nodeCount++;
  709. console.log('Amount of Nodes' + nodeCount);
  710. node.setAttribute("style", "font-size:10.5px;position:reltive;top:-4px;letter-spacing:1px;color:#0e2;");
  711. /* Set a delay so script shows last */
  712. setTimeout(function () {
  713. if (!document.querySelector('._5pcq').parentNode.innerHTML.match(/copybtnP"|s2img"/)) {
  714. /*uncomment-to-enable/* Node Counter console.log('(' + NumIncr++ + ') ' + node.innerText); */
  715. var PosterName = 'Posted By: '+node.closest('._6a._5u5j._6b').children[0].innerText;
  716. var PostInformation = node.innerText;
  717. var PostCategory = document.getElementsByClassName('_5pcq')[1].parentNode.innerText.replace(' · ','');
  718. var PostContent = node.closest('.n_1zif-ycce.h_1zif-v9xd.clearfix').nextSibling.innerText;
  719. if(!PostCategory) {
  720. console.log(PosterName+'\n'+PostInformation+'\n\n'+PostContent)
  721. }
  722. else {
  723. console.log(PosterName+'\n'+PostInformation+'\n\n'+PostContent+'\n\nPost Category: ['+PostCategory+']')
  724.  
  725. }
  726. //console.log('node is'+node.className);
  727. if(!document.querySelector('._5pcq').parentNode.innerHTML.match(/copybtnP"|s2img"/)) {
  728. //if (!node.parentNode.innerHTML.match(/copybtnP"|s2img"/)) {
  729. node.insertAdjacentHTML('afterend', '<input type="button" class="copybtnP" name="copyp" value="Copy Text"/>');
  730. node.insertAdjacentHTML('afterend', '<br><input type="button" class="s2img" name="s2img" value="Export Status"/>');
  731. }
  732. //node.parentNode.parentNode.nextSibling.nextSibling.insertAdjacentHTML('afterend', '<input type="button" class="copybtnP" name="copyp" value="Copy Text"/>');
  733. //node.parentNode.parentNode.nextSibling.nextSibling.insertAdjacentHTML('afterend', '<br><input type="button" class="s2img" name="s2img" value="Export Status"/>');
  734. }
  735. }, 0);
  736. })
  737. });
  738. setMutationHandler({
  739. target: document.querySelector('.fbPhotosPhotoCaption'),
  740. selector: '.hasCaption',
  741. handler: nodes => nodes.forEach(node => {
  742. node.style.color = '#f00';
  743. var PhotoCaption = document.getElementsByClassName('hasCaption')[0];
  744. console.log('Current Image: ' + PhotoCaption.innerText);
  745. if (!document.getElementsByClassName('fbPhotosPhotoCaption')[0].innerHTML.includes('copybtn"')) {
  746. PhotoCaption.insertAdjacentHTML('afterend', '<input type="button" class="copybtn" name="copy" value="Copy"/>');
  747. }
  748. var copyTextareaBtn = document.querySelector('.copybtn');
  749. copyTextareaBtn.addEventListener('click', function (event) {
  750. var copy_text = document.getElementsByClassName("hasCaption")[0];
  751. var range = document.createRange();
  752. range.selectNode(copy_text);
  753. window.getSelection().addRange(range);
  754. try {
  755. var successful = document.execCommand('copy');
  756. var msg = successful ? 'successful' : 'unsuccessful';
  757. console.log('Copying text command was ' + msg);
  758. } catch (err) {
  759. console.log('Oops, unable to copy');
  760. }
  761. });
  762. })
  763. });
  764.  
  765. function pad(n, width, z) {
  766. z = z || '0';
  767. n = n + '';
  768. return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
  769. }
  770.  
  771. function expandDates(e) {
  772. 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"))
  773. }
  774.  
  775. function RecentTimestamps(e) {
  776. for (var t, n = 0; t = e[n++];)
  777. if (!t.querySelector(".full-timestamp")) {
  778. if (1 == t.innerText.includes("min")) {
  779. var a = t.innerText.match(/[0-9]{1,2}/),
  780. s = parseInt(a, 10);
  781. 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>')
  782. }
  783. if (1 == t.innerText.includes("hr")) {
  784. var r = t.innerText.match(/[0-9]{1,2}/),
  785. m = parseInt(r, 10),
  786. o = 10 * parseInt(moment(new Date).format("mm") / 10, 10),
  787. l = 10 * parseInt(moment(new Date).format("ss") / 10, 10);
  788. 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>')
  789. }
  790. }
  791. }
  792.  
  793. function RecentPostURLs(e) {
  794. if (e.parentNode) {
  795. for (var a = 0; a < e.length; a++) {
  796. var r = e[a];
  797. !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=.+/, "").match(/facebook.com\/[a-z|A-Z|[0-9|\-|_|.]+.[a-zA-Z|[0-9|\-|_|.|]+[a-zA-Z|[0-9|\-|_|.|?=]+/) + "</span>"))
  798. }
  799. }
  800. }
  801.  
  802. function ExternalURLs(e) {
  803. for (var n = 0; n < e.length; n++) {
  804. var r = e[n],
  805. a = r.href.replace(/https:\/\/l\.facebook.com\/l.php\?u=/, "");
  806. !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>")
  807. }
  808. }
  809.  
  810. function expandPostIDs(e) {
  811. for (var r = 0; r < e.length; r++) {
  812. var p = e[r];
  813. !1 === p.innerHTML.includes("<br>") && "_5pcq" === p.className && p.insertAdjacentHTML("beforeend", "<br>" + p.href.replace(/(\?__xts__%.+|\/\?type=\d&__xts__%.+)/gm, "").replace("permalink.php?", "&nbsp;permalink.php?").replace("/groups/", "Group: ").replace("/permalink/", "<br>Post ID: ").slice(24, 100).replace("/", ""))
  814. }
  815. }