Apply rule on URL after SPA route changes

Consider an example of Youtube Music website which is a Single Page Application (SPA).
When we open https://music.youtube.com/browse/xid, it redirects to https://music.youtube.com/playlist?list=yid.

If we create URL modification rules like Redirect, Replace, Add query params on above redirected URL, they simply don’t work.

It was found that the application silently updated the URL using some routing mechanism. Since there was no actual page request on redirection which Requestly could intercept and modify, the rules we created on the redirected URL do not work.

There is a history JS API is modern browsers which is generally used by Single Page Applications for in-app routing. The changes in URL, this way, don’t trigger another page request.
(ref: History.replaceState() - Web APIs | MDN)

Probably there are ways to detect browser history changes externally using Javascript and reload the page using “Insert Scripts” rule in Requestly, so other URL modification rules could be applied.

Github issue: Apply rules for already "redirected" sites (YouTube Music page) · Issue #225 · requestly/requestly · GitHub (raised by ge9)

Cross-linking the original Github ticket for shared context - Apply rules for already "redirected" sites (YouTube Music page) · Issue #225 · requestly/requestly · GitHub