A-SOUL r/place 2022 Protector

Protect A-SOUL in r/place!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         A-SOUL r/place 2022 Protector
// @namespace    http://tampermonkey.net/
// @version      0.10
// @description  Protect A-SOUL in r/place!
// @author       You
// @match        https://hot-potato.reddit.com/embed*
// @match        https://www.reddit.com/r/place/
// @icon         https://external-content.duckduckgo.com/ip3/www.reddit.com.ico
// @grant        none
// @license      AGPL
// ==/UserScript==

if (window.top !== window.self) {
  window.addEventListener('load', () => {
    function createMask() {
      const img = document.createElement('img');
      img.src = 'https://openbayes-public.cn-bj.ufileos.com/asoul-place-v10.png';
      img.style = 'position: absolute; top: 0; left: 0; width: 2000px; height: 2000px; image-rendering: pixelated;';
      console.log('A-SOUL r/place 2022 Protector', img);
      return img;
    };

    document.getElementsByTagName('mona-lisa-embed')[0].shadowRoot.children[0].getElementsByTagName('mona-lisa-canvas')[0].shadowRoot.children[0].appendChild(createMask())
  }, false);
}