1

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.

  • Welcome. This looks like a good question to me. Have you already read this? https://developer.chrome.com/docs/extensions/mv2/content_scripts/ – react_or_angluar Dec 15 '20 at 05:34

0 Answers0