I've created a simple plugin for Chrome, that provide me some functions, for example, a function to create a new cookie when pressing some keys.
When the page loads, I can see that the file was loaded (because if I print something in this plugin, Chrome shows me where is the JS that did that.).
My question is: how can I use the function of this js in console?
Example of my plugin:
manifest.json
{
"name":"Function helpers",
"description":"",
"version":"1",
"manifest_version":2,
"content_scripts": [{
"matches": ["http://localhost:9999/*"],
"js": ["jquery.js", "myscript.js"]
}
]
}
myscript.js
console.log("It works!");
var helper = {
createCookie = function (){
console.log("Cookie created!");
}
}
Chrome's console shows me:
It works! - myscript.js:1
I would like to be able to call the function helper.createCookie() of myscript.js file in Chrome's console.