is there any way to disable javascript:window.print();

User Help for Mozilla Firefox
Post Reply
User avatar
diesel_travis
Posts: 133
Joined: September 16th, 2003, 11:31 pm
Location: Rochester, NY
Contact:

is there any way to disable javascript:window.print();

Post by diesel_travis »

I looked in the about:config, but i didn't see anything in there.
javascript:window.print(); can be such an annoying "feature", hopefully there's a way to disable it in Firefox - or if I could at least turn it off when it's used in an onload event.

Thanks,
Travis
User avatar
the-edmeister
Posts: 32249
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Post by the-edmeister »

Use NoScript to block JavaScript from that domain?


Ed
A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.
User avatar
diesel_travis
Posts: 133
Joined: September 16th, 2003, 11:31 pm
Location: Rochester, NY
Contact:

Post by diesel_travis »

That would work for one site, but I'd like to just ditch the feature altogether since I always click cancel. It really sucks when it happens in a new tab and takes over too.
User avatar
Giorgio Maone
Posts: 3516
Joined: September 21st, 2004, 12:05 am
Location: Palermo - Italy
Contact:

Post by Giorgio Maone »

You can do this by adding the following line to your user preferences file (user.js):

Code: Select all

user_pref("capability.policy.default.Window.print", "noAccess");
User avatar
diesel_travis
Posts: 133
Joined: September 16th, 2003, 11:31 pm
Location: Rochester, NY
Contact:

Post by diesel_travis »

That seems to do the trick, thanks!
User avatar
diesel_travis
Posts: 133
Joined: September 16th, 2003, 11:31 pm
Location: Rochester, NY
Contact:

Post by diesel_travis »

hmm, now whenever a link opens a new window I get this alert box:

TypeError: url has no properties
User avatar
diesel_travis
Posts: 133
Joined: September 16th, 2003, 11:31 pm
Location: Rochester, NY
Contact:

Post by diesel_travis »

is there a way to disable the Alert: "TypeError: url has no properties" message as well?
Post Reply