Foreword: I am amateur, just trying to make my own js script to make some task easier on myself.
I'm using and learning JavaScript.
The code(s) I've tried:
window.history.go(-1);
history.back
What I wanted to do:
Make a script that goes back a page when it encounters a certain page stated in the @match metadata.
What happened: I tested on Chrome DevTool Console and it worked. The page goes back and all is well. I include it in a Tampermonkey script, and it doesn't seem to work. It's like it's ignored altogether. The metadata seemed to be working fine, since it's the same metadata I used for another script and they work alright.
My question:
How can I make this work?
The whole script:
// @name MFP reload 1.0
// @namespace http://tampermonkey.net/
// @version 1
// @description reload when encountering error
// @author Miso
// @match https://www.myfitnesspal.com/exercise/copy_workout?*
// @match https://www.myfitnesspal.com/exercise/add_favorites
// @grant none
// ==/UserScript==
window.history.back();