Trigger TAB in background Safari window?

Is there a way to send keystrokes to background applications using AppleScript and ObjC?

I’m trying to trigger field input parsing in a React app which only seems to happen when the TAB key is pressed. (I’m also investigating manipulating React directly.)

At present, I have this routine in an .applescript file

on tabNext()
	tell application "Safari"
		activate
		delay 1
		tell application "System Events" to keystroke tab
	end tell
end tabNext

My aim is to eliminate the necessity to bring Safari to the foreground.

Safari has a do JavaScript command.