Moving away from Safari to any other better supported browser like Firefox or Opera would be the easiest way.
As
@Heindijs mentioned, that iMac officially can be upgraded to HighSierra.
But with that i5 iMac You can even upgrade to patched_Mojave without any stomach ache or great effort.
Patched_Catalina would be also possible, but You'll loose 32bit support, which might be critical for Your parents iMac, since iPhoto and Aperture would then stop working. With patched_Mojave You may even keep the harddrive in HFS+ partition-scheme (instead of APFS) and Mojave is a lot more faster than Catalina.
Before going the patched-upgrade way it's important to have 2-3 clone backups on external USB-drives at hand. It's important anyway for every Mac.
Patch-Upgrade with a
patcher from
@dosdude1 is a no-brainer. He should be on Apple's pay-roll for his extraordinary work!
1. Create a 16GB partition with DiskUtility at the very end of Your parents iMac harddrive.
2. Download the patcher from
http://dosdude1.com/software.html
3. Install the patcher and download / install the patched macOS-installer to that 16GB partition (instead of the recommended USB-stick. So You have a Patch-Utility allways at hands)
4. Boot from the 16GB partition (press ALT on booting to choose the booting-drive), that holds the patched macOS installer and run the macOS upgrade on the iMac's system-partion.
5. After finishing the macOS-Upgrade reboot again from the 16GB macOS-installer partition and run the patcher to fit macOS to Your current iMac hardware.
6. Boot into Your iMacs system partition
I've done that a lot of times with a bunch of different Core2Duo-Macs without ever having any trouble.
On the other hand HighSierra is the last supported macOS-version and is said to offer a slightly better performance compared to Mojave, but it lacks the dark theme of Mojave, which I do prefer very much.