Hello!

I want to add object to window, that i could cause its methods, and get access to its fields.

var data = window.some_variable.GetData()

But i don't know how it's made.

I think it's made by means of the content script.

manifest:
Code:
... 
"content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js" : ["contentscript.js"]
	}
...
contentscript.js:

Code:
location.href = "javascript:void(window.someVariable = "+new MyObj()+")";
var MyObj= function()
{
	this.test = function(){return "test";}
	
}

It's not work!!!

I try run alert(window.someVariable.test()), and error, but when i run alert(window.someVariable) return object.

Please help me)