Write a basic browser extension for Chorme

Source: Internet
Author: User
Keywords Extensions Chorme base browser
Tags aliyun base browser based basic browser browser extensions download example

You can build the same base extension for each browser, feel what it's like to extend each browser, and it's difficult or simple to perform these common tasks, and what your extension will involve. In this article, you will build a Chrome extension.

Before you start

For this article, you will need to download and install Google Chrome V19 or later (this example is based on V19). You also need some tools to edit HTML, CSS, and http://www.aliyun.com/zixun/aggregation/33906.html ">javascript." It would be helpful if you had the experience of using chrome or Chrome extensions. Take a moment to browse the Chrome Web Store. Look at the extension provided and try it first, which will provide some background for this article.

Why build Browser extensions?

There are several reasons you want to build a browser extension, and the common application of browser extensions is to create an interaction between one browser and another application or service. Evernote, 1Password, and Adobe Shadow do this, just like many other extensions. Or, you want to add some new features to a browser that lacks that functionality by adding developer tools or screenshots utility. Some developers write extensions for specialized purposes, such as sports scoring tracker, specific site enhancements, and weather forecasts. People can use extensions to do a lot of different things. What are you going to do?

What extensions do you want to build?

To demonstrate the build extension process in Chrome, you need to write an extension called Gawkblocker. Gawkblocker will allow you to lock down certain domains that you are trying not to access for various reasons. Gawkblocker contains the following components:

A pop-up window (showing the domain you are going to lock) a visible browser icon (extended entry point) an option page (Configure the domain you want to lock and the field you want to access)

In general, Gawkblocker will attach a listener to each tab or window, and the extension will compare URLs and lock the list of domains when the URL of the selected card changes. If the URL matches a locked field, the request is redirected to an extended page (see Figure 1).

Figure 1. Gawkblocker extension

Gawkblocker extends to browsers in a specific way to do some specific work that will be done in other extensions. You need to answer these questions:

How hard is it to have a place in the browser UI? What does persisting data between browser sessions involve? How do different extension parts communicate with each other? How deeply do you study user data?

The process of building gawkblocker should be able to answer these questions.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.