Changing a page's URL parameters
问题 I want to add the parameter &vhs=1 at the end of each YouTube video URL on my browser. I have tried using the following script but it gets stuck in a loop (keeps adding &vhs=1 &vhs=1... ). // ==UserScript== // @name Youtube Tape Mode // @namespace _pc // @match *://*.youtube.com/watch?* // @run-at document-start // ==/UserScript== var oldUrlPath = window.location.pathname; /*--- Test that "&vhs=1" is at end of URL, excepting any "hashes" or searches. */ if ( ! /\&vhs=1$/.test (oldUrlPath) ) {