GreaseMonkey: Correctly run scripts in frames

Closes #1457