How to write a greasemonkey script to remove a confim dialog?

You need to think of unsafeWindow. ConfirmIt as a variable in addition to a function (which it is). So, the way to do what you're attempting in your code would be: var oldFunction = unsafeWindow.

ConfirmIt; unsafeWindow. ConfirmIt = function(message) { return true; } Try that.

You need to think of unsafeWindow. ConfirmIt as a variable in addition to a function (which it is). So, the way to do what you're attempting in your code would be: var oldFunction = unsafeWindow.

ConfirmIt; unsafeWindow. ConfirmIt = function(message) { return true; }; Try that.

Worked! Thank you. Curious though, I don't care about accessing the variable message in my function, but what if I did want to, how would I do that if I don't seem to have access to the parameters?

– Sam I Am Jul 27 '10 at 2:41 You do have access to the parameters. Your function is defined as taking a parameter which it refers to as "message". You could say unsafeWindow.

ConfirmIt = function(message) {alert(message); return true;}; and it would work exactly as you'd expect. – Hellion Jul 27 '10 at 6:50.

I wanted to write a very simple greasemonkey script because I hate the "are you sure?" javascript confirmation on a site I use a lot. I'm just going to use it for personal use, not going to publish it or anything. After some Googling I found http://wiki.greasespot.net/UnsafeWindow explaining what it seems that I want to do.

I'm not sure if I'm going about this right (I'm thinking not), but I'd appreciate some guidance from someone with more experience in Greasemonkey, about how to replace a Javascript function on a page.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions