Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
How to create a simple Chrome extension?

First of all you need to enable developer mode in Chrome in order to debug your extension before publishing. Head over to chrome:// extensions in your browser, or simply click “More Tools” and “Extensions” on the Chrome menu. This should lead you to the Extension Management page, where you can turn on Developer Mode (it should be in the top right corner).

OK! Create a directory and put a file called manifest.json into it with the below content:

{
"name": "Name of the extension",
"description": "Description of the extension",
"version": "1.0",
"background": {
"scripts": [ "background.js" ]
},
"browser_action": {
"default_icon": "icon.png",
"default_title": "Your Extension Title"
},
"icons": {
"128": "icon_128.png"
},
"manifest_version": 2,
"permissions": ["activeTab", "tabs", "contextMenus"]
}

background section is used to link a javascript file to your extension (You need to create a file background.js in your newly created directory).

permissions section is used when you want specific permissions in your js file. contextMenus is used to work on menu items related to your extension. tabs is used to open a new tab on chrome browser.

In the next post I will explain the JS section.

#chrome #extension