Disclaimer: Firefox is my daily driver. There are sites that just make FF spike its CPU usage, I guess through rogue JS, and if you let them run they’ll make macOS stutter (this on a beefy 2016 mbp). Sadly, some of these are big names like new Reddit and new Facebook.
Are you running any adblockers? I haven't experienced this personally on newer and older mac hardware than your rig.
Yes - uBlock Origin and Disconnect.
Everything freezes, I can't use move the mouse. If I wait, sometimes I can hit Cmd-W and get the tab to close eventually, sometimes I literally have to do a hard power off.
That sounds like it could be that you're running out of memory.
Open the Activity Monitor, switch to the Memory tab, and watch the Memory Pressure graph as well as Memory Used. If memory pressure isn't green, or memory used is close to Physical Memory, you're using too much. In that state, the whole MacOS GUI can become rather unresponsive, fitting your description.
I agree with the sibling comment, what you are describing sounds like you are running out of RAM. This happens to me with Firefox on a PC with 64GB of RAM and the cursor gets janky and I have to wait until some poor process gets killed and the PC becomes interactive again and I can restart Firefox.
I haven't experienced this on my 2020 macbook nor my 2012 macbook. Care to link an example of some heavy javascript?
What does "crash the computer" mean? Do you get the MacOS equivalent of a BSOD?