safari – applescript: wait for the page to be fully loaded

I'm using this script for Google Chrome to pause the script until the page is fully loaded:

Tell the application "Google Chrome"
repeat until (the loading of tab 2 of the front window is false)
1 + 1 - just an arbitrary line
end of repetition
Load the tab of the front window 2
tell him at the end 

This does not seem to work with Safari, something equivalent?
Thanks in advance.