-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTM-loader.auto.min.js
1 lines (1 loc) · 2.23 KB
/
TM-loader.auto.min.js
1
const MineTm={pageLoadHref:window.location.href,isMobile:/iPhone/i.test(navigator.userAgent),iciLite:(e,t)=>{const n=document.createElement("style");return t&&(n.id=t),n.textContent=e,document.head.appendChild(n),()=>n.remove()},hideSidebarTemporarilyAsync:async()=>MineTm.iciLite('\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")};MineTm.iciLite('\n[data-element-id="chat-space-end-part"] {\n opacity: 0;\n transition: opacity 0.25s;\n}\n\n\n\ntextarea:not([placeholder^="Message"])::placeholder {\n color: transparent !important;\n}\n'),(async()=>{MineTm.hideSidebarTemporarilyAsync();const e=MineTm.isMobile;(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:not(:focus)"].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`,t=MineTm.iciLite(e);setTimeout(t,1e3)})();const t=async(e="")=>{const t=`https://pepperpotts.fly.dev/tm${e?`-${e}`:""}.auto.min.js`,n=`mine_cached_tm${e?`-${e}`:""}_js`;let i=localStorage.getItem(n);const a=!i;a&&(i=await fetch(t).then((e=>e.text())),localStorage.setItem(n,i),alert("busted cache for (likely new) extension loading"));const o=document.createElement("script");o.text=i,o.setAttribute("data-mine","true"),document.head.appendChild(o),a||fetch(t).then((e=>e.text())).then((t=>{t!==i&&(localStorage.setItem(n,t),MineTm.Mine?.toast(`🆕 Updated ext. "${e||"TM"}"`))}))};await t(""),setTimeout((async()=>{t("phonecall"),!e&&t("wouldbut"),!e&&t("commandbar")}),1e3)})();