您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Rewrite Near Explorer URLs to Near Blocks URLs when coming from https://app.mynearwallet.com/
// ==UserScript== // @name Near Block Explorer URL Rewriter // @namespace http://tampermonkey.net/ // @version 1.0 // @description Rewrite Near Explorer URLs to Near Blocks URLs when coming from https://app.mynearwallet.com/ // @author You // @match *://explorer.mainnet.near.org/accounts/* // @match *://explorer.mainnet.near.org/transactions/* // @grant none // ==/UserScript== (function() { 'use strict'; // Function to check if the referring URL is https://app.mynearwallet.com/ function isFromMyNearWallet() { return document.referrer.startsWith("https://app.mynearwallet.com/"); } // Function to replace the URL part for accounts and transactions function replaceURL() { // Get the current URL let currentURL = window.location.href; // Check if the referring URL is https://app.mynearwallet.com/ if (isFromMyNearWallet()) { // Check if it's an account URL if (currentURL.includes("explorer.mainnet.near.org/accounts/")) { // Replace the part of the URL let newURL = currentURL.replace("explorer.mainnet.near.org/accounts/", "nearblocks.io/address/"); // Redirect to the new URL window.location.replace(newURL); } // Check if it's a transaction URL if (currentURL.includes("explorer.mainnet.near.org/transactions/")) { // Replace the part of the URL let newURL = currentURL.replace("explorer.mainnet.near.org/transactions/", "nearblocks.io/txns/"); // Redirect to the new URL window.location.replace(newURL); } } } // Call the function to replace the URL replaceURL(); })();