You can create the required rules in Requestly and then using its APIs, import them in your automation where Requestly extension is installed. Your modified JavaScript would appear.