-
Notifications
You must be signed in to change notification settings - Fork 0
/
TM-loader.auto.min.js
1 lines (1 loc) · 1.95 KB
/
TM-loader.auto.min.js
1
const MineTm={pageLoadHref:window.location.href};(async()=>{const e=async(e,t="")=>{const n=`mine_cached_tm${t?`-${t}`:""}_js`;let a=localStorage.getItem(n);const i=!a;i&&(a=await fetch(e).then((e=>e.text())),localStorage.setItem(n,a),alert("busted cache for (likely new) extension loading"));const s=document.createElement("script");s.text=a,s.setAttribute("data-mine","true"),document.head.appendChild(s),i||fetch(e).then((e=>e.text())).then((e=>{e!==a&&(localStorage.setItem(n,e),MineTm.Mine?.toast(`Updated extension "${t||"TM"}"`))}))},t=(e,t)=>{const n=document.createElement("style");return t&&(n.id=t),n.textContent=e,document.head.appendChild(n),()=>n.remove()};(async()=>{t('\n[data-element-id="nav-container"] {display:none !important;}\n.z-30, .lg\\:pl-0 {padding-left: 0 !important;}\n[data-element-id="main-content-area"] {padding-left: 0 !important;}\ntextarea::placeholder {color: transparent !important;}\n',"mine_loader_styler")})();const n=/webOS|iPhone/i.test(navigator.userAgent);(async()=>{MineTm.fsQssToMakeInvisible=['.hide-when-print:has([data-element-id="chat-space-beginning-part"])',"#elements-in-action-buttons",'[data-element-id="pinned-characters-container"]>div:first-child'],MineTm.fsQssToMakeInvisibleAndUndisplay=["div:has(>#elements-in-action-buttons)",'[id^="message-timestamp-"]',".mine_notes:placeholder-shown"].filter(Boolean),MineTm.fsOtherCss='\n[data-element-id="chat-input-actions"] {max-height:0;overflow: hidden;padding-bottom:0;padding-top:0;}\n'.trim();const e=`\n${MineTm.fsQssToMakeInvisible.map((e=>`${e}`)).join(",\n")} {visibility:hidden;}\n${MineTm.fsQssToMakeInvisibleAndUndisplay.map((e=>`${e}`)).join(",\n")} {display:none;}\n${MineTm.fsOtherCss}\n[data-element-id="chat-input-actions"] {display:none;}\n`,n=t(e);setTimeout(n,1e3)})(),await e("https://pepperpotts.fly.dev/tm.auto.min.js",""),setTimeout((async()=>{const t=t=>e(`https://pepperpotts.fly.dev/tm-${t}.auto.min.js`,t);t("phonecall"),!n&&t("wouldbut"),!n&&t("commandbar")}),1e3)})();