Firefox do JavaScript

I am baffled why this script will work in Safari, but not in Firefox? Can anyone explain what I am doing wrong?

tell application "Firefox"
	activate
	do JavaScript "javascript:self.moveTo(0,0); self.resizeTo(screen.availWidth,screen.availHeight);" in document 1
end tell

Hi,

the reason is, FireFox is NOT scriptable

I had a feeling that was the reason. Thank you Stefan for letting me know as quickly as you did.

-Jeff

Will someone please write an osax to add some AppleScript script-ability to Firefox please? If Firefox won’t do it, we need a hero!

Just do Safari. Don’t mess with Firefox to do something that only works on your computer.

I found a 3rd party command-line tool that is useful in this case, and I used it for a script that works to make the window of the front app full screen. A slight modification allows me to move a window to full screen on my second monitor. It’s called hmscreens. The same guy makes other command-line tools that are also very useful. All of them take some getting used to, but they work great! Here’s the code for front app, full screen on main screen.

set front_app to (path to frontmost application as Unicode text)
set HMS to quoted form of POSIX path of "Applications:hmscreens"
set screen1 to paragraph 3 of (do shell script HMS & " -info")
repeat with thisItem in "GlobaPstion:{} "
	set AppleScript's text item delimiters to thisItem
	set screen1 to text items of screen1 as string
	set AppleScript's text item delimiters to ""
end repeat
set AppleScript's text item delimiters to ","
set screen1 to text items of screen1
--set AppleScript's text item delimiters to " "
--set screen1 to text items of screen1 as string -- if numbers with spaces is preferred
set AppleScript's text item delimiters to ""

tell application front_app
	set bounds of front window to screen1
end tell