Ask coding questions

← Back to all posts
How do I turn a website into a chrome extension?
TheNethrRaven (86)

How do I turn a website into a chrome extension? I would like to make one of my games into an extension.

Answered by ch1ck3n (2039) [earned 5 cycles]
View Answer
Comments
hotnewtop
ch1ck3n (2039)

https://developer.chrome.com/docs/extensions/mv2/getstarted/

once you get everything started (manifest.json and background.js)

put this in your background.js

background.js

chrome.browserAction.onClicked.addListener(function(activeTab){
  var newURL = "http://replit.com/";
  chrome.tabs.create({ url: newURL });
});

manifest.json:

{
  "name": "My game",
  "version": "1.0",
  "description": "My game!",
  "background": {
    "scripts": ["background.js"],
    "persistent": false
  },
  "manifest_version": 2
}

and go to chrome->extensions and turn developer mode on.

click load unpacked, and click on the folder where your manifest.json and background.js are.

hope this helped

ch1ck3n (2039)

@ch1ck3n This one is best because i taught you how to do it

ch1ck3n (2039)

@Ravens0606 pumps fist
i finally got a marked answer

UnluckyFroggy (823)

What do you mean by that? Like a chrome app? or a redirect extension that takes people to your website?