Facebook (Show Timestamps on Posts)

Show Full Timestamp Information on FB Posts

  1. // ==UserScript==
  2. // @name Facebook (Show Timestamps on Posts)
  3. // @match https://www.facebook.com/*
  4. // @match http://www.facebook.com/*
  5. // @icon https://www.google.com/s2/favicons?domain=facebook.com
  6. // @run-at document-start
  7. // @grant GM_addStyle
  8. // @author JZersche
  9. // @require https://gf.qytechs.cn/scripts/12228/code/setMutationHandler.js
  10. // @version 1.0
  11. // @namespace https://gf.qytechs.cn/users/95175
  12. // @description
  13. // @description Show Full Timestamp Information on FB Posts
  14. // ==/UserScript==
  15.  
  16. /////////////STYLESHEET////////////////
  17. var styles = `.ijkhr0an.art1omkt.s13u9afw{background:#0000!important;box-shadow:none;opacity:1;} .d2edcug0.oo9gr5id.hzawbc8m{color:#fffc;background-image: linear-gradient(to left, white, green, white, blue, violet;);-webkit-background-clip: text;}`
  18. var styleSheet = document.createElement("style")
  19. styleSheet.type = "text/css"
  20. styleSheet.innerText = styles
  21. document.head.appendChild(styleSheet)
  22. ///////////////////////////////////////
  23.  
  24. let ii = 0;
  25. setInterval(function(){
  26. setMutationHandler(document,'.tojvnm2t.a6sixzi8.abs2jz4q.a8s20v7p.t1p8iaqh.k5wvi7nf.q3lfd5jv.pk4s997a.bipmatt0.cebpdrjk.qowsmv63.owwhemhu.dp1hu0rb.dhp61c6y.iyyx5f41',Show_Timestamps,{processExisting:true});
  27.  
  28. function Show_Timestamps(nodes) {
  29.  
  30. for (let i = 0; i < nodes.length; i++) {
  31. var NODE = nodes[i];
  32. if(NODE.textContent.match(/(posts|photos)/)){
  33. try{
  34. let event = new MouseEvent('mouseover',{bubbles:true})
  35. let event2 = new MouseEvent('mouseout',{bubbles:true})
  36. NODE.dispatchEvent(event);
  37.  
  38. if(NODE.children[0].children[0].children[0].children[1]) {
  39. for (let i = 0; i < NODE.children[0].children[0].children[0].children[1].childElementCount; i++) {
  40. if(NODE.children[0].children[0].children[0].children[1].children[i].style.top){
  41.  
  42. try{NODE.children[0].children[0].children[0].children[1].removeChild(NODE.children[0].children[0].children[0].children[1].children[i]);}catch(e){}
  43.  
  44. let stampAmount = document.getElementsByClassName('j34wkznp qp9yad78 pmk7jnqg kr520xx4 hzruof5a').length;
  45. if(ii < stampAmount && window.location.href.length == 36) {NODE.children[0].children[0].children[0].setAttribute('style','border:1px solid #f00!important;border-radius:3px;padding:2px;'); NODE.children[0].children[0].children[0].children[1].textContent = ii+' '+document.getElementsByClassName('j34wkznp qp9yad78 pmk7jnqg kr520xx4 hzruof5a')[ii].textContent + ' (Estimated)'; ii++; }
  46. if(ii < stampAmount && window.location.href.match(/posts/)[0]) {NODE.children[0].children[0].children[0].setAttribute('style','border:0px solid #0f0!important;border-radius:3px;padding:0px;'); NODE.children[0].children[0].children[0].children[1].textContent = ii+' '+document.getElementsByClassName('j34wkznp qp9yad78 pmk7jnqg kr520xx4 hzruof5a')[ii].textContent; ii++; }
  47. if(ii > stampAmount) {NODE.children[0].children[0].children[0].setAttribute('style','border:1px solid #00f!important;border-radius:3px;padding:2px;'); NODE.children[0].children[0].children[0].children[1].textContent = ii+' '+document.getElementsByClassName('j34wkznp qp9yad78 pmk7jnqg kr520xx4 hzruof5a')[0].textContent; ii++}
  48. console.log(NODE.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.children[0].children[ii].children[0].children[0].children[0].children[0].children[0].textContent);
  49. //console.log(NODE.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.children[0].children[ii].children[0].children[0].children[0].children[0].children[0].textContent);
  50. //console.log(NODE);
  51. //NODE.children[0].children[0].children[0].children[1].textContent = 'aaa';
  52. }
  53. //if(!NODE.children[0].children[0].children[0].children[1].children[i].style.top){console.log(NODE.children[0].children[0].children[0].children[1].textContent)}
  54. }
  55. NODE.dispatchEvent(event); NODE.dispatchEvent(event2);
  56. }
  57. } catch(e){}
  58.  
  59.  
  60. }
  61. }}
  62. },3000)

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址