当前位置:网站首页>Chrome extension development Chinese tutorial-1
Chrome extension development Chinese tutorial-1
2022-06-23 21:27:00 【User 1349575】
Create and load an extension
In this section , Will write a browser action Expand , This extension will add an icon to the Google browser toolbar .
1. Create a directory on disk , Code and resources for extension
2. In this directory , Create a text file , Name it manifest.json, Its content is :
{
"manifest_version": 2,
"name": "One-click Kittens",
"description": "This extension demonstrates a browser action with kittens.",
"version": "1.0",
"permissions": [
"https://secure.flickr.com/"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}3. Put this icon in the directory :
4. Load extension
a) Click on
Icon , Select tools from the menu > add-in , This opens the page for extension management
b) If “ Developer mode ” There is a “+” Number , Click on this. “+” No. 1 enters developer mode .“+” The number one will become “-” Number , More buttons and information will be displayed
c) Click on “ Load the extension being developed …” Button , A file selection dialog box will appear
d) In the dialog box , Locate the extension directory and click “ determine ”
If the extension is correct , Its icon will be displayed on the right side of the address bar , The extended information will also be displayed on the extension management page , As shown in the figure below :
Add code to the extension
In this section , It will add a little function to the extension
1. edit manifest.json file , Add the following :
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}In the extended Directory , Create a file called popup.html Text file for , Add some code :CSS and JavaScript code for hello_world
2. Return to the extension management page , Click on “ Update the extension now ” Button , The modified extension will be reloaded
3. Click the extended icon , A bubble window will pop up , Show popup.html The content of the document . Look like the following :
If you can't see this bubble , Please do it again strictly according to the above steps . Note that if you try to load anything outside the extension Directory html Files will fail .
边栏推荐
- Markdown syntax summary
- What software is safe to use to fight new debts? What are the new bond platforms
- Using asp Net core MVC framework for building web applications
- Global and Chinese market of microphone racks 2022-2028: Research Report on technology, participants, trends, market size and share
- Summary of multiple methods for obtaining the last element of JS array
- Excel text function
- Advantages of short video automatic audit? What are the difficulties of manual audit?
- Use of paging components in fusiondesign
- I'm in Shenzhen. Where can I open an account? Is online account opening safe?
- Elegant asynchronous programming version answer async and await parsing
猜你喜欢

Four aspects of PMO Department value assessment

Beitong G3 game console unpacking experience. It turns out that mobile game experts have achieved this

How PMO uses two dimensions for performance appraisal

How does PMO select and train project managers?

Gradle asked seven times. You should know that~

New SQL syntax quick manual!

How to gradually improve PMO's own ability and management level

How to view the role of PMO in agile organizations?

Lightweight, dynamic and smooth listening, hero earphone hands-on experience, can really create
![Harmonyos application development -- mynotepad[memo][api v6] based on textfield and image pseudo rich text](/img/b1/71cc36c45102bdb9c06e099eb42267.jpg)
Harmonyos application development -- mynotepad[memo][api v6] based on textfield and image pseudo rich text
随机推荐
Wechat is new. You can create applications from Excel
Nodejs operation state keeping technology cookies and sessions
[development skills] how to add "live broadcast" status display bar on easynvr platform
How to create cloud disk service how to create cloud disk service backup?
Game security - call analysis - write code
How to gradually improve PMO's own ability and management level
How to build a cloud game platform on the server? How to select a cloud game server?
Is it safe to open an account for flush stock?
Model selection and optimization
What software is safe to use to fight new debts? What are the new bond platforms
What are the processing methods for PPT pictures
Global and Chinese market of cloud billing services 2022-2028: Research Report on technology, participants, trends, market size and share
How to check whether the service is running normally after easydss cluster transcoding is set up?
SAP retail wrmo replenishment monitoring
Go local variables & global variables
How to deal with product pictures? How to select mapping software?
Customize view to imitate today's headlines and like animation!
Gin security -3: fast implementation of CSRF verification
New SQL syntax quick manual!
Global and Chinese market of gas fire pit 2022-2028: Research Report on technology, participants, trends, market size and share