How do I modify the 'window' object properties in Gecko?

So, I have this idea, and for that I want to modify the window object. First I want to do something simple like window.sayMyName() to print my name in the console. Please suggest me how to go about it.

I am trying to get around the source code, I first narrowed down to getting to know working of window.alert() function. I am still figuring it out but I am no where close to understanding the working.

If you can provide me something, anything, any links to docs, maybe even a github repo that did something similar, I would appreciate that very much. :pray:

Your request is simple:

window.BadTechniqueSayMyName = function() { console.log(“My name.”); };
window.BadTechniqueSayMyName();

But what are you trying to accomplish? If I saw someone use or recommend that approach I wouldn’t trust any code they generated.

Find another approach for your goal.