Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Javascript enable macro for Firefox 1.5.x.x


  • Please log in to reply
1 reply to this topic
rilian
  • Members
  • 4 posts
  • Last active: Jun 27 2009 01:43 AM
  • Joined: 06 Jun 2006
I am interesteded in writing a couple of macros that can check the state of the javascript.enabled user pref in Firefox (True or False) and then either reverse it or leave it alone. I would want one enable macro that would exit leaving javascript.enable reading true and another macro that would exit leaving the same pref false.

I already wrote a script that could toggle it based on sending key strokes and using relative mouse location and it works fine but I'd like to have my cake and eat it too..so to speak.

I have searched these forums and on google and can't find any way to retrieve or write that preference dynamically yet I know it should be possible since Firefox does it. I was able to write a user.js that worked on one machine that forced the pref one way or another on starting firefox (though it won't work on my other machine for some bizarre reason) but user.js appears to be read only during startup of firefox and I want to change this pref on the fly at any given time that FF is open.

I would appreciate any help any of you could give me and thanks for creating such a wonderful tool!

My current toggle script and user.js are posted below if anyone wants to review them as part of this thread...

------------my current toggle script text follows here--------------
;script runs on FF 1.5.x.x..not tested on earlier version..would need
;changes as menus are different in earlier versions
^#j::
settitlematchmode, 2
IfWinExist Mozilla Firefox         ;is firefox open? make it the active window if yes
{                                  ;if no, branch off to else code
	WinActivate Mozilla Firefox
}
else                               ;firefox not open. Display dialog asking user to open ff before running macro.
{
	msgbox,,JavaScript Toggle - Error, Firefox does not appear to be open. Please open firefox and re-run this macro
	return                         ;kill macro since FF not open
}

send !t                            ;open tools menu
sleep, 100
send o                             ;open options
sleep, 500
mouseclick, left, 263,55,1,0 ;click on correct sub-menu button
loop,9                             ;hit tab 9x to get to correct setting
{
 send {tab}
}
send {space}					   ;toggle setting
send {enter}					   ;press enter to close options window
return
;end script
---------------------------contents of my user.js file--------------------
user_pref("javascript.enabled","false");
-----------------------------------------------------------------------------

_enrica?
  • Guests
  • Last active:
  • Joined: --
Maybe you know this extension:
http://www.noscript.net/whats
If no, I suggest to try.
Ciao!