change browser in script to work with brave browser instead of safari

theres a script used to search a song playing in spotify on but it currently only works with safari.

this is the script

--@Felipeforerome Adapted from the iTunes Song.Link widget

if application "Spotify" is running then
tell application "Spotify"
set theTrack to name of the current track
set theArtist to artist of the current track
end try
end tell
return ""
end if

tell application "Safari"
	tell window 1
		set current tab to (make new tab with properties {URL:"" & theTrack & " - " & theArtist})
	end tell
end tell

on error
return "Couldn't open Genius"
end try

If I change "Safari" to "Brave Browser" which is the full name of the application the script doesn't run

Quite sure that brave doesn't support Apple script. To check, open Apple script, and navigate to the dictionary in the menu items. Then search for Brave Browser.