I am a beginner with no web knowledge.
I want to make a chrome extension that simply changes the value of a variable in the chrome dev tool console, but I'm having a lot of trouble.
manifest.json
{
"manifest_version": 2,
"name": "Var Changer",
"description": "umm...",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": ["activeTab"]
}
popup.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="script.js"></script>
</head>
<body>
</body>
</html>
script.js
chrome.tabs.executeScript({
code: 'alert(myVar);'
});
This is my code. I want to change the value of a variable in the content page.
I googled how to access dom from stackoverflow but i don't know how to do it.