diff --git a/client/Terminal-00-Multiuser.user.js b/client/Terminal-00-Multiuser.user.js index 94ac0d1..07e5461 100644 --- a/client/Terminal-00-Multiuser.user.js +++ b/client/Terminal-00-Multiuser.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name MultiProbe // @namespace https://*.angusnicneven.com/* -// @version 20241013.2 +// @version 20241030.0 // @description Probe with friends! // @author tgpholly // @match https://*.angusnicneven.com/* @@ -64,7 +64,7 @@ console.log("[MP] MultiProbe init"); 'use strict'; // Make sure to change the userscript version too!!!!!!!!!! - const USERSCRIPT_VERSION_RAW = "20241013.2"; + const USERSCRIPT_VERSION_RAW = "20241030.0"; const USERSCRIPT_VERSION = parseInt(USERSCRIPT_VERSION_RAW.replace(".", "")); if (!continueRunningScript) { @@ -529,16 +529,21 @@ mp_button { } let clientWidth = document.documentElement.getBoundingClientRect().width; - let bodyBoundingRect = document.documentElement.getBoundingClientRect(); + let htmlBoundingRect = document.documentElement.getBoundingClientRect(); + let bodyBoundingRect = document.body.getBoundingClientRect(); - setInterval(() => { - bodyBoundingRect = document.documentElement.getBoundingClientRect(); + const resizeCursorContainer = () => { + htmlBoundingRect = document.documentElement.getBoundingClientRect(); + bodyBoundingRect = document.body.getBoundingClientRect(); if (document.documentElement.scrollHeight > window.innerHeight) { - otherCursors.style = `width:${clientWidth = bodyBoundingRect.width}px;height:${document.documentElement.scrollHeight}px;cursor: ${cssCursor};`; + otherCursors.style = `width:${clientWidth = bodyBoundingRect.width > htmlBoundingRect.width ? bodyBoundingRect.width : htmlBoundingRect.width}px;height:${document.documentElement.scrollHeight}px;cursor: ${cssCursor};`; } else { - otherCursors.style = `width:${clientWidth = bodyBoundingRect.width}px;height:${window.innerHeight}px;cursor: ${cssCursor};`; + otherCursors.style = `width:${clientWidth = bodyBoundingRect.width > htmlBoundingRect.width ? bodyBoundingRect.width : htmlBoundingRect.width}px;height:${window.innerHeight}px;cursor: ${cssCursor};`; } - }, 1000); + } + + setInterval(resizeCursorContainer, 1000); + document.addEventListener("resize", resizeCursorContainer); const debugMessageContainer = document.createElement("mp_container"); debugMessageContainer.style = "position:fixed;top:0;left:0;padding:8px;margin:4px;pointer-events:none;text-shadow: 0px 0px 4px black;z-index:999999999999;background-color:rgba(0,0,0,0.5);outline:1px solid white;backdrop-filter:blur(6px)";