YouTube Network Speed: Show MB/s with Tampermonkey
Preface
Saw a group friend's YouTube video info page where network speed is converted to MB/sMy hands are itching, I also want to make one myself.
Analysis
Open F12 developer tools, select the HTML element of the network speed on the video info panel.
Right-click menu, Copy JS path
The HTML element path of the text displaying network speed is
document.querySelector("#movie_player > div.html5-video-info-panel.ytp-sfn > div > div:nth-child(9) > span > span:nth-child(2)")
Developing with GPT
I have an HTML page,
in which an element at this position 1)
document.querySelector("#movie_player > div.html5-video-info-panel.ytp-sfn > div > div:nth-child(9) > span > span:nth-child(2)")
has content in the format 17085 Kbps,
I need to add an element 2) after this element 1), with content showing the value from element 1) converted to the unit MB/s.
The number in element 2) should refresh every 10 seconds
The result developed by GPT, first tested in the F12 tools console.
The effect is normal.
Fix this script's effect with Tampermonkey plugin
Specific detailed steps are omitted.
Tampermonkey plugin
The script file name should be xxx.user.js
In @match, use https://www.youtube.com/watch* to match all YouTube playback page URLs
Fill the code developed by GPT below // Your code here ...
Upload to GitHub
========
Postscript
In this process of using GPT, the GPT used is
========




