Hi guys,
I have created one google chrome extension to get key pressed values from active tab.
<!DOCTYPE html>
<html>
<head>
<script src="popup.js"></script>
</head>
<body>
<h3><center>Key Logger</center></h3>
<hr>
<label>Unable/Disable</label><input type="checkbox" name="chk" id="chk">
<br />
<textarea name="sdata" id="sdata" cols="30" rows="10"></textarea>
</body>
</html>
var x;var y="";var d = new Date();
myFunction();
function myFunction(event) {
x = event.which || event.keyCode;
y += x == 13 ? "<br />" : String.fromCharCode(x);
document.getElementById("sdata").innerHTML = d + "<br />" + y;
}
What I have tried:
Manifest.json
{
"name":"Key Logger",
"description":"It will store all the keys used during browsing.",
"version":"1.0.0",
"manifest_version": 2,
"browser_action":{
"default_icon":"icon.png",
"default_popup":"popup.html"
},
"content_scripts": [
{
"matches": ["*://*/*"],
"js": ["popup.js"]
}
],
"permissions":[
"tabs",
"storage",
"activeTab"
]
}
Can anyone please help me. How to get the key pressed value from active tab.
Thanks in advance.