sarkyScript

Tracks and logs the actions of dgg users

// ==UserScript==
// @name         sarkyScript
// @namespace    https://www.destiny.gg/
// @version      0.5
// @description  Tracks and logs the actions of dgg users
// @match        *://*.destiny.gg/embed/chat*
// @run-at       document-start
// @grant        none
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAByFBMVEVHcEyVpaa9w8eVpaaVpaaVpaa9w8eVpaaVpaaVpaa9w8e9w8eVpaaVpaa9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e8wsa9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8eFk5S9w8e9w8e9w8e9w8e9w8d/jI29w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8eEkZK9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8eVpaaUpKWCkJGLmJqUpKWttbiZo6aVpabrkKO9w8fs8PGVpaZ/jI3P19jr7/GCkJGToqO+xMjS2Nrm6+zq7/DCyMzBxsri5ujIzdDGzM/o7O7W297e4uTL0NPg5efM0dTp7e/n6+3Dyc3a3+HO09bl6evc4ePFy87Jz9LV2t3j6Onf5OXP1NfU2dy/xcnY3d/R1tm6wcWKlpeGkpO4vsKOmZu1vL+wuLurs7ajra+dp6mBjo+TnZ+YoqVdOQZ7AAAAYnRSTlMAXP5V610B+/wvCfxXVgPeFSXnzvALMTp7DTSg7hFhhvK79W5rKSJ3i/4/5AbU0ZZVGF1C4Xazr7b2Zh/aw/l0v5Ps6cejjnBFpn6ryxz7m9dO3FlK+C1RgvdeVf52XLP+6Uu37dEAABhxSURBVHja7J1rUxNLE4Cp/cCHUEUg3EEgWigUdwwFggYQUEEgggLi55lT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0h3sDF69W+wSf+yNP+JtoAGO3J4NeXB67frpW5qn/dgIGqEvz0FhRHSgJTp6VfWYYoHg+0F1XpBPDkU/rB1Q8MQxQnrPXehpcvuLX2HLSp+px/wADXFgctk72nXJptX/l9IRf6cPCAHfiO1t/Iah0j6Dk/Ez/7YD6J4UB7sXfOlQ3peD/jC8Fx1smQm49JQxweSxovtUirMGdjk9rZisC7j4hDChGyms7h672Bgs8Pajq6Bke6qzu8hXl2WBAMV8LAycnOvtrztX1Nn4yFjw/WFY5MlJ5cfB8cOyTxp66qzVNNydqm0NFfigYYHtgAAyAATAABsAADwz4AL2HAQgMQGAAAgMQGIDAAAQGIDAAgQEIDEBgAAIDEBiAwAAEBiAwAIEBCAxAYAACAxAYgMAABAYgMACBAQgMQGAAAgMQGIDAAMQAA95D76024I/vo/U2GwD+dhsA/nYbAP6a5U8nwB8GgD8MAH8YAP4wAPxhAPjDAPCHAeAPA8AfBoA/DAB/GAD+MAD8YQD4wwDwhwHgDwPAHwaAPwwAfxgA/jAA/GEA+MMA8IcB4A8DwB8GgD8MAH8YAP6WGwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+1ubrE+BvvQHgb7cB/wR/uxNCCxAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQZBf8l+JnQ/CPeEgKgAAAABJRU5ErkJggg==
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

  const menuIcon64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAByFBMVEVHcEyVpaa9w8eVpaaVpaaVpaa9w8eVpaaVpaaVpaa9w8e9w8eVpaaVpaa9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e9w8e8wsa9w8e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MQGIDAAAQGIDAAgQEIDEBgAAIDEBiAwAAEBiAwAIEBCAxAYAACAxAYgMAABAYgMACBAQgMQGAAAgMQGIDAAMQAA95D76024I/vo/U2GwD+dhsA/nYbAP6a5U8nwB8GgD8MAH8YAP4wAPxhAPjDAPCHAeAPA8AfBoA/DAB/GAD+MAD8YQD4wwDwhwHgDwPAHwaAPwwAfxgA/jAA/GEA+MMA8IcB4A8DwB8GgD8MAH8YAP6WGwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+dhsA/nYbAP52GwD+1ubrE+BvvQHgb7cB/wR/uxNCCxAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQZBf8l+JnQ/CPeEgKgAAAABJRU5ErkJggg==";
  let friends = [];
  let lastMsg = {};

  try {
    const storedFriends = localStorage.getItem("sark_friends");
    if (storedFriends) {
      friends = JSON.parse(storedFriends);
    }
  } catch (e) {
    console.error(e);
    friends = [];
  }


  function convertToJSON(prefixedData) {
    const firstSpaceIndex = prefixedData.indexOf(" ");
    const prefix = prefixedData.substring(0, firstSpaceIndex);
    const data = JSON.parse(prefixedData.substring(firstSpaceIndex + 1));

    return { prefix, data }
  }

  function addMenu() {
    const menuBtnContainer = document.createElement("a");
    menuBtnContainer.setAttribute("title", "sarky");
    menuBtnContainer.className = "chat-tool-btn";

    const menuBtn = document.createElement("img");
    menuBtn.className = "btn-icon";
    menuBtn.src = menuIcon64;

    const menuTitle = document.createElement("h1");
    menuTitle.textContent = "List of names to track";

    const menuDesc = document.createElement("p");
    menuDesc.textContent = "Seperate the names with commas using no spaces";


    menuBtnContainer.addEventListener("click", function(e) {
      // console.log("clicked menu button");

      const menuDialog = document.createElement("dialog");
      menuDialog.style.cssText = "background: #333; color: #999; width: 80%; height: 70%; position: relative;";
      document.body.appendChild(menuDialog);
      menuDialog.showModal();


      const friendsInput = document.createElement("textarea");
      friendsInput.style.cssText = "width: 100%; height: 100%; background: #030303; color: #b9b9b9";
      // console.log("sark_friends", friends);
      friendsInput.value = friends;

      friendsInput.addEventListener("input", function(e) {
        let friendsInputValue = friendsInput.value.toLowerCase();
        friends = friendsInputValue.split(",").map(f => f.trim()).filter(f => f);
        localStorage.setItem("sark_friends", JSON.stringify(friends));
      });

      const closeMenuBtn = document.createElement("button");
      closeMenuBtn.style.cssText = "background: red; padding: 2px;";
      closeMenuBtn.textContent = "X";
      closeMenuBtn.addEventListener("click", () => {
        menuDialog.close();
      });
      menuDialog.appendChild(closeMenuBtn);
      menuDialog.appendChild(menuTitle);
      menuDialog.appendChild(menuDesc);
      menuDialog.appendChild(friendsInput);

    });


    const chatToolsGroup = document.querySelector(".chat-tools-group");
    menuBtnContainer.appendChild(menuBtn);
    chatToolsGroup.appendChild(menuBtnContainer);
  }

  function addMessage(nick, msg, color) {
    console.log(nick, msg, color);
    const chatLines = document.querySelector(".chat-lines");
    if (!chatLines) {
      console.error("couldnt find chat-lines");
    }
    const msgWords = msg.split(" ");

    const msgElement = document.createElement("div");
    msgElement.className = "msg-chat msg-user";
    msgElement.setAttribute("data-username", nick.toLowerCase());
    msgElement.style.cssText = `background: ${color}; color: white; margin: 2px`;

    const msgUser = document.createElement("a");
    msgUser.className = "user";
    msgUser.textContent = nick;
    msgElement.appendChild(msgUser);

    const msgCtrl = document.createElement("span");
    msgCtrl.className = "ctrl";
    msgCtrl.textContent = ":"
    msgElement.appendChild(msgCtrl);

    const msgText = document.createElement("span");
    msgText.className = "text";
    msgElement.appendChild(msgText);
    if (msgWords[1]) {
      console.log("embed");
      const embedLink = document.createElement("a");
      embedLink.style.className = "externallink bookmarklink";
      embedLink.setAttribute("target", "_top");
      embedLink.href = "https://www.destiny.gg/bigscreen" + msgWords[1];
      embedLink.textContent = msgWords[1];
      msgText.textContent = " opened ";
      msgElement.appendChild(embedLink);
    } else {
      msgText.textContent += " " + msg;
    }

    chatLines.appendChild(msgElement);


    return true;
  }


  //
  //
  //
  //
  //

    console.log('WebSocket interceptor starting...');

    // Store the original WebSocket constructor
    const OriginalWebSocket = window.WebSocket;

    // Override the WebSocket constructor
    window.WebSocket = function(url, protocols) {
        console.log('WebSocket intercepted to:', url);

        // Create a WebSocket instance using the original constructor
        const socket = new OriginalWebSocket(url, protocols);

        // Add event listeners instead of overriding onmessage
        socket.addEventListener('message', function(event) {
          // console.log(event);
          if (event.origin == "wss://chat.destiny.gg") {
            try {
              let { prefix, data } = convertToJSON(event.data);

              if (!data.nick) return;
              if (friends.includes(data.nick.toLowerCase())) {
                if (prefix == "JOIN") {
                  addMessage(data.nick, "JOIN", "green");
                } else if (prefix == "QUIT") {
                  addMessage(data.nick, "QUIT", "red")
                } else if (prefix == "UPDATEUSER") {
                  // console.log("UPDATE USER!");
                  if (lastMsg.watching && data.watching) {
                    if (lastMsg.watching.id == data.watching.id) return;
                  }
                  if (data.watching === null) {
                    lastMsg = data;
                    return addMessage(data.nick, "closed embed", "#2d1b4b");
                  }
                  addMessage(data.nick, ("opened " + "#" + data.watching.platform + "/" + data.watching.id), "#2d1b4b");
                  lastMsg = data
                }
              }
            } catch (e) {
              console.error(e);
            }
          }
        });

        return socket;
    };

    // Copy properties from original WebSocket to our overridden version
    for (const prop in OriginalWebSocket) {
        if (OriginalWebSocket.hasOwnProperty(prop)) {
            window.WebSocket[prop] = OriginalWebSocket[prop];
        }
    }

    window.WebSocket.prototype = OriginalWebSocket.prototype;

    window.addEventListener('load', function() {
        setTimeout(function() {
            addMenu();
            console.log(window);
        }, 1000);
    });

    console.log('WebSocket interceptor initialized');
})();

QingJ © 2025

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