您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add column "Daily deaths per million" to see fairly the daily deaths impact on each country, regardless of population size.
// ==UserScript== // @name COVID-19 Add daily death per million column // @namespace http://tampermonkey.net/ // @version 0.1 // @description Add column "Daily deaths per million" to see fairly the daily deaths impact on each country, regardless of population size. // @author Clément Dufour // @match https://www.worldometers.info/coronavirus/ // @grant none // ==/UserScript== (function() { 'use strict'; const nameColumn = Array.from(document.querySelector('#main_table_countries_today thead tr').children).map(col => col.textContent); const indexDailyDeath = nameColumn.indexOf("NewDeaths"); const indexPop = nameColumn.indexOf("Population"); document.querySelectorAll('.main_table_countries_div').forEach((table) => { const parentThead = table.querySelector('thead tr'); const childAfter = parentThead.querySelector('th:nth-child(6)'); const newChild = childAfter.cloneNode(); newChild.innerText = 'New Deaths/ 1M pop'; newChild.ariaLabel = 'New Deaths/ 1M pop : activate to sort column descending' parentThead.insertBefore(newChild, childAfter); const bodyTable = Array.from(table.querySelector('tbody').children); bodyTable.forEach((row) => { const dailyDeath = parseInt(row.children[indexDailyDeath].textContent.replaceAll(',','')); const pop = parseInt(row.children[indexPop].textContent.replaceAll(',','')); const deathsPerMillion = Math.round((dailyDeath / (pop / 1000000)) * 100 ) / 100; const cellAfter = row.querySelector('td:nth-child(6)'); const newCell = cellAfter.cloneNode(); if (dailyDeath && !Number.isNaN(deathsPerMillion)) { newCell.innerText = `+${deathsPerMillion}`; } row.insertBefore(newCell, cellAfter); }); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址