Create your own browser extensions: Extend your tentacles to Chrome

Source: Internet
Author: User
Tags extend new features

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 that you can use to edit HTML, CSS, and JavaScript. It would be helpful if you had the experience of using chrome or Chrome extensions. Spend a little time browsing through 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 all 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 which domain you want to lock and which 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

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.