How to modify script.js (or any file)

127 views
Skip to first unread message

Lamp

unread,
Aug 17, 2018, 8:03:28 PM8/17/18
to Multiplayer Piano Forum

How to modify script.js

While there’s lots of things you can do by just injecting JS, some things cannot be done because much of the code is protected in scope, so you have to modify the script directly.

The old way of doing it was to put the script.js in Tampermonkey as a userscript, and block http://www.multiplayerpiano.com/script.js with AdBlock, but there is a better way using an extension specifically designed for this purpose, Resource Override.

  1. Install Resource Override extension for Chrome
  2. Create a Tab Rule for http://www.multiplayerpiano.com/*
  3. Create a URL → File rule for */script.js

    Your rules should look like this: 

  4. Go to http://www.multiplayerpiano.com/script.js and copy all the code
  5. Go back to Resource Override, click Edit File and paste the code in.

That’s it! Now you can modify your copy and it should override the original script.

You can use this method to modify other files, such as Client.js

Reply all
Reply to author
Forward
0 new messages