您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Ping Counter for Bloxd.io
当前为
- // ==UserScript==
- // @name Ping Counter
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Ping Counter for Bloxd.io
- // @author Ankit
- // @match https://bloxd.io
- // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
- // @grant none
- // ==/UserScript==
- class PingCounter {
- constructor(url) {
- this.url = url;
- this.pingCount = 0;
- // Create an element to display ping time
- this.pingTimeDisplay = document.createElement('div');
- this.pingTimeDisplay.id = 'pingTimeDisplay';
- this.pingTimeDisplay.innerText = 'Ping : ';
- // Style the ping time display
- this.pingTimeDisplay.style.position = 'fixed'; // Fix position
- this.pingTimeDisplay.style.top = '10px'; // Distance from the top
- this.pingTimeDisplay.style.left = '50%'; // Center horizontally
- this.pingTimeDisplay.style.transform = 'translateX(-50%)'; // Adjust for center alignment
- this.pingTimeDisplay.style.padding = '10px'; // Padding for better spacing
- this.pingTimeDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; // Semi-transparent background
- this.pingTimeDisplay.style.color = 'white'; // Text color
- this.pingTimeDisplay.style.borderRadius = '5px'; // Rounded corners
- this.pingTimeDisplay.style.fontSize = '20px'; // Font size
- this.pingTimeDisplay.style.zIndex = '1000'; // Ensure it's above other content
- // Append the element to the body
- document.body.appendChild(this.pingTimeDisplay);
- }
- ping() {
- const start = new Date().getTime();
- fetch(this.url, { method: 'HEAD', mode: 'no-cors' })
- .then(() => {
- const end = new Date().getTime();
- const pingTime = end - start;
- // Update ping time on screen
- this.pingTimeDisplay.innerText = `Ping : ${pingTime} ms`;
- this.pingCount++;
- })
- .catch((error) => {
- console.error('Ping failed:', error);
- });
- }
- startPinging(interval) {
- this.ping();
- setInterval(() => this.ping(), interval);
- }
- }
- // Usage
- const pingCounter = new PingCounter('https://bloxd.io');
- pingCounter.startPinging(1500); // Ping every 1.5 seconds
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址