Last Updated: February 16, 2016

How to create google chrome extension in 3 simple steps?

Description: In this post I'm gonna show you 3 simple steps to create your own google chrome extension.You can simply follow the steps with tips and note listed in between the post.

So lets get started.




Step 1: Create a folder namely('chrome_extension_demo') with 4 files in it index.html, main.js, manifest.json & extension.css.

Step 2: Lets add code into above files.
Tip: you can simply open the folder in any editor like(Sublime or Notepad++ for ease to write code)

  • index.html(contains our basic html code with few buttons on it)

<html>
<head>
 <title>Code2Concept extension demo</title>
 <script src="main.js"></script>
 <link rel="stylesheet" type="text/css" href="extension.css">
</head>
<body background="bg.png">
 <h1 align="center" id="code2concept"><a href=""><font color="white">Code2Concept</font></a></h1>
 <center>
  <div class="buttonContainer">
   <div>
    <button id="home" class="button">Home</button>
    <br/>
    <br/>
   </div>
   <div >
    <button id="twitter" class="button">Twitter</button>
    <br/>
    <br/>
   </div>
   <div>
    <button id="my_linkedin" class="button">My LinkedIn</button>
    <br/>
    <br/>
   </div>
   <div>
    <button id="stackoverflow" class="button">Stackoverflow</button>
    <br/>
   </div>
  </div>
  <hr/>
  <h5> <font color="white">This is the demo to create google chrome extension.</font></h5>
 </center>
</body>
</html>



  • manifest.json(simple json file which is needed by chrome to add extension)
{
  "manifest_version": 2,

  "name": "Code2Concept extension demo",
  "description": "This is the Code2Concept extension to demostrate chrome extension",
  "version": "1.0",

  "background":{
  "scripts": ["main.js"]
  },
  
  "browser_action": {
   "default_icon": "icon.png",
   "default_popup": "index.html"
  },
  "permissions": [
   "activeTab"
   ]
}

  • main.js(javascript code to add listener to our buttons)
document.addEventListener('DOMContentLoaded', function() {

 //home
  var home = document.getElementById('home');
  home.addEventListener('click', function() { 
    openUrl('http://bit.ly/1LqS9ku');
  }, false);

   //twitter
  var twitter = document.getElementById('twitter');
  twitter.addEventListener('click', function(){
    openUrl('http://bit.ly/20XuV1K');
  }, false)

  //stackoverflow.
  var stackoverflow = document.getElementById('stackoverflow');
  stackoverflow.addEventListener('click', function(){
   openUrl('http://bit.ly/1olt4D5');
  }, false)

//my linkedIn public dir.
  var my_linkedin = document.getElementById('my_linkedin');
  my_linkedin.addEventListener('click', function(){
   openUrl('http://bit.ly/1Tn6BBJ');
  }, false)


  //open url function in new tab
  function openUrl(newURL) {
    chrome.tabs.create({ url: newURL});
  }

}, false);



  • extension.css(css for buttons)
.button {
 border: 1px solid #13cbbb;
    border-radius: 3px;
    color: #FFFFFF;
    display: inline-block;
    float: center;
    font-size: 12px;
    margin-right: 3.2%;
    background-color: #13cbbb;
    padding: 7px 4.0%;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}
.button:hover {
 background-color:#13cbbb;
 opacity: 0.7;
}
.button:active {
 position:relative;
 top:1px;
}

.buttonContainer{
    width: 160px;
}

Note: You can download bg.png from here  and  icon.png  from here and place in the folder created in step 1:




Step 3: The most important step is how to add our code in chrome browser. Open chrome settings from hamburger icon on the right of  browser. Settings --> extensions --> load unpacked extension(select your folder created instep 1) --> fig.1


Chrome extension code2concept

Finally you'll see the your extension add to the chrome as shown in fig.2.
Chrome extension
fig.2

  • If you find some issue implementing simply download and follow step 3.

  • To upload on chrome web store go here since we have developed this into developer mode.

Bingo!!! you have created your first chrome extension successfully.

83 comments :

  1. Replies
    1. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .

      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training

      Delete
  2. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Buy Pinterest Followers

    ReplyDelete
  3. Data migration services offered by your company have helped in passing all the series of functions entirely, which are necessary for data transformation.

    ReplyDelete
  4. I recently came across your blog and read along. I thought I would leave my first comment. I don’t know what to say except what I’ve enjoyed reading. Great blog I will be visiting this blog very easily. Buy Negative Google Reviews

    ReplyDelete
  5. hi, your site is fantastic. I truly do many thanks for operate web design new york

    ReplyDelete
  6. This is very interesting, You are a very professional blogger. I’ve joined your rss feed and look ahead to in search of more of your wonderful post. Also, I’ve shared your website in my social networks! new york web designs

    ReplyDelete
  7. Amaze! Thank you! I constantly wished to produce in my internet site a thing like that. Can I take element of the publish to my blog? san francisco brand agency

    ReplyDelete
  8. The Texas Transportation Institute has estimated the cost of traffic congestion at USD 87.2 billion in wasted fuel and lost productivity. artificial intelligence courses in hyderabad

    ReplyDelete
  9. This is always happy to know about Salesforce training in Gurgaon whose certification program helps many to get certificed. I strongly urge you to join now in Salesforce Training in Hyderabad | Course Price | Training institute and enroll for free demo at Salesforce Training in Bangalore | Course Certification Cost and Job Placement Assistance . I have gone through this Salesforce Certification Training. Why done you enroll for a free demo at Salesforce training institutes in Chennai [updated] | Course Price

    ReplyDelete
  10. Step-by-Step create website Easy to Customize, Publish Now! Custom domain name. Multiple payment methods. Free multilingual fonts. 24/7 support center. 1000s of free images. Top industry hosting. 100s of Apps. Easy-to-add blog. Mobile optimized. Create Website

    ReplyDelete
  11. Hey, great blog, but I don’t understand how to add your site in my reader. Can you Help me please?
    Tropic Diva

    ReplyDelete
  12. You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site.
    Tropic Diva

    ReplyDelete
  13. This program is viewed as a serious application however it is helpless against getting defiled or harmed. Clients have vouched for seeing many Chrome blunder messages. Brighter Guide homepage

    ReplyDelete
  14. Hey, great blog, but I don’t understand how to add your site in my reader. Can you Help me please?
    bandar slot terpercaya

    ReplyDelete
  15. When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. cfa pdf

    ReplyDelete
  16. Thanks for the post. It was very interesting and meaningful. I really appreciate it! Keep updating stuff like this.
    Data Science
    Selenium
    ETL Testing
    AWS
    Python Online Classes

    ReplyDelete
  17. I recently found many useful information in your website especially this blog page.nice informastion. Thanks for sharing .
    Buy Negative Google Reviews

    ReplyDelete
  18. I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. BUY GOOGLE REVIEWS

    ReplyDelete
  19. Great article! Among the lots of comments on your articles. Thanks for sharing.
    Get Facebook reviews

    ReplyDelete
  20. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... google meet extension

    ReplyDelete
  21. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. google meet extension

    ReplyDelete
  22. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. joker auto

    ReplyDelete
  23. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work https://hostinglelo.in/

    ReplyDelete
  24. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also google ads tricks

    ReplyDelete
  25. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... agencje rekrutacyjne it

    ReplyDelete
  26. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. buy google reviews

    ReplyDelete
  27. Discovering pictures to remember for your digital book is simpler than any time in recent memory with a straightforward public domain search by means of Google since it's pressed brimming with them!
    https://onohosting.com/

    ReplyDelete
  28. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. dark web links

    ReplyDelete
  29. office cleaning edinburgh I precisely needed to thank you so much yet again. I do not know the things I would’ve taken care of without these secrets contributed by you regarding this problem. It seemed to be a very frightful crisis for me, but encountering a new well-written tactic you processed it forced me to jump with contentment. Now i am happier for the work and hope you are aware of an amazing job you happen to be getting into educating people through your web blog. Probably you haven’t come across any of us.

    ReplyDelete
  30. lezaalava I precisely needed to thank you so much yet again. I do not know the things I would’ve taken care of without these secrets contributed by you regarding this problem. It seemed to be a very frightful crisis for me, but encountering a new well-written tactic you processed it forced me to jump with contentment. Now i am happier for the work and hope you are aware of an amazing job you happen to be getting into educating people through your web blog. Probably you haven’t come across any of us.

    ReplyDelete
  31. back pain I’m not that much of a internet reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your site to come back in the future. All the best

    ReplyDelete
  32. Home depot health check I precisely needed to thank you so much yet again. I do not know the things I would’ve taken care of without these secrets contributed by you regarding this problem. It seemed to be a very frightful crisis for me, but encountering a new well-written tactic you processed it forced me to jump with contentment. Now i am happier for the work and hope you are aware of an amazing job you happen to be getting into educating people through your web blog. Probably you haven’t come across any of us.

    ReplyDelete
  33. online casino real money I precisely needed to thank you so much yet again. I do not know the things I would’ve taken care of without these secrets contributed by you regarding this problem. It seemed to be a very frightful crisis for me, but encountering a new well-written tactic you processed it forced me to jump with contentment. Now i am happier for the work and hope you are aware of an amazing job you happen to be getting into educating people through your web blog. Probably you haven’t come across any of us.

    ReplyDelete
  34. online casino real money canada His or her shape of unrealistic tats were initially threatening. Lindsay utilized gun first basic, whereas this girl snuck outside by printer ink dog pen. I used absolutely sure the all truly on the shade, with the tattoo can be taken from the body shape. make an own temporary tattoo

    ReplyDelete
  35. I read your article , your content is well and I like it Thank you For this.Buy Verified PayPal Account

    ReplyDelete
  36. Wow awesome blog post. Really thank you! Fantastic.
    instagram photo downloader

    ReplyDelete
  37. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I really like your writing style, wonderful information, thank you for posting. Quality content is what always gets the visitors coming.Buy Facebook Ads Accounts

    ReplyDelete
  38. Buy Verified PayPal Account PayPal is the main means of transferring money worldwide. You can quickly transfer money from one place to another in a very short time. No problem. PayPal account is one of the most popular business in the world. PayPal is a very popular means of payment system. People become helpless without PayPal. PayPal has given the opportunity to transact money from one place to another all over the world. PayPal is a very popular payment system that allows you to easily transfer money from one place to another.

    ReplyDelete
  39. I precisely needed to thank you so much yet again. I do not know the things I would’ve taken care of without these secrets contributed by you regarding this problem. It seemed to be a very frightful crisis for me, but encountering a new well-written tactic you processed it forced me to jump with contentment. Now i am happier for the work and hope you are aware of an amazing job you happen to be getting into educating people through your web blog. Probably you haven’t come across any of us. covens in maryland

    ReplyDelete
  40. I read your aritacle And it's very good
    Buy Gmail Accounts

    ReplyDelete
  41. I precisely needed to thank you so much yet again. I do not know the things I would’ve taken care of without these secrets contributed by you regarding this problem. It seemed to be a very frightful crisis for me, but encountering a new well-written tactic you processed it forced me to jump with contentment. Now i am happier for the work and hope you are aware of an amazing job you happen to be getting into educating people through your web blog. Probably you haven’t come across any of us. เธšเธฒเธ„เธฒเธฃ่เธฒ

    ReplyDelete
  42. Choose from our great range of the finest Kilt Jackets. Browse our collection of Evening, Day and Argyll Kilt Jackets. Buy your Kilt Jacket online now.Utility kilts

    ReplyDelete
  43. Good job on this article! I really like how you presented your facts and how you made it interesting and easy to understand. Thank you. เธ„เธฒเธชิเน‚เธ™

    ReplyDelete
  44. https://www.coderconsole.com/2016/02/how-to-create-google-chrome-extension.html

    ReplyDelete
  45. I read your article.very good and informative content.thanks for itKilt for sale

    ReplyDelete
  46. Nice to be visiting your blog once more, it continues to be months for me. Nicely this post that i’ve been waited for so lengthy. I want this article to total my assignment in the university, and it has same topic together with your post. Thanks, terrific share. baccarat

    ReplyDelete
  47. Shop incredible deals at Element ะฒะตะนะฟะพะฒะต, a progressive online retail establishment serving the vaping community with mod kits



    ReplyDelete
  48. The number one retail store of hold fragrances in Pakistan, stockpiling a strong brand portfolio such as Chanel, Dior, John Ford, and Paco Rabanne.alfaris perfume price in pakistan

    ReplyDelete
  49. Couvreur 95 c'est une Entreprise familiale depuis 30 ans, spรฉcialiste des couvertures toitures.Nous connaissons tous les types de toitures et notre expรฉrience fait de nous une rรฉfรฉrence dans le mรฉtier.

    ReplyDelete
  50. I read your essay and found it to be well-written and interesting. Thank you for this.Buy Verified PayPal Account

    ReplyDelete
  51. Your essay was well-written and entertaining, and I liked reading it. Thank you once again.Buy Verified PayPal Account

    ReplyDelete
  52. I read your post and found it to be well-written and interesting.Buy Verified PayPal Accounts

    ReplyDelete
  53. Couvreur Marseille, c'est un artisan depuis plus de 30 ans avec une extrรชme attention et un savoir-faire que vous retrouver uniquement avec un Couvreur Zingueur expรฉrimentรฉ comme lui.beautour patrice

    ReplyDelete
  54. I read all of your articles on your website and found them to be extremely interesting. Thank you for sharing.Rak money exchange

    ReplyDelete
  55. Exceptional article, This website's content is filled with optimism and motivation. It makes me happy to read it. You're doing a fantastic job. Thank you very much.Gali result

    ReplyDelete
  56. My interest was peaked by all of your entries on your website, so I read them all. I appreciate you sharing this information. Buy Verified PayPal Account

    ReplyDelete
  57. I have read all of your website's articles. I find this to be really educational. I appreciate you sharing.Buy Google 5 Start Reviews

    ReplyDelete
  58. I’m going to read this. I’ll be sure to come back. thanks for sharing. Buy SendGrid Account
    Buy SendGrid Accounts We are providing 100% verified premium SendGrid Account at the cheapest rate. Along with we give. https://usaloqal.com/product/buy-sendgrid-accounts/

    ReplyDelete
    Replies
    1. Good work pleace . https://usaloqal.com/product/buy-sendgrid-accounts/

      Delete
  59. You made some excellent points here. Amazing stuff I believe you brought up some excellent points. Continue your wonderful work.Online Quran teaching

    ReplyDelete
  60. All of your entries on your website caught my attention, and I read them all. Thank you for providing this information.Buy Verified Binance Account

    ReplyDelete
  61. I'm very glad I found this article. It was very distinctive. like the book a lot. The pictures are great. You might find more like it. Definitely read your blogs. Buy Verified Paxful Account

    ReplyDelete
  62. Buy Verified PayPal Account. Buy USA, UK, CA, AUS phone number and Bank verified and Credit Card verified Cheap Old PayPal account. No limit.
    https://smmseomarket.com/product/buy-verified-paypal-account/

    ReplyDelete
  63. Check out NFT_GuruCreator's NFTs on OpenSea, the largest marketplace for crypto collectibles.cheap NFT in opensea

    ReplyDelete
  64. This post is excellent and fascinating. I appreciate you sharing this insightful knowledge. Buy Verified Binance Account

    ReplyDelete
  65. Buy Verified PayPal Accounts Most of the famous payment methods in the world today are PayPal . We are offers Fully USA, UK, Canadian Verified. Buy Verified PayPal Accounts

    ReplyDelete
  66. Buy Verified PayPal Account. Buy USA, UK, CA, AUS phone number and Bank verified and Credit Card verified Cheap Old PayPal account. No limit.
    https://smmseomarket.com/product/buy-verified-paypal-account/

    ReplyDelete
  67. Buy Google Reviews. USA, UK, CA Buy Positive Google Reviews. Buy Google 5 Star rating are fully depended upon the customers Verified Profile.Buy Google Reviews

    ReplyDelete
  68. Buy Verified Paxful Account. Buy UK, USA, CA, AUS phone number and Bank verified and Credit Card verified Paxful account. 100% Verified.Buy Verified Paxful Account

    ReplyDelete
  69. Buy Verified PayPal Accounts. USA, UK, CA phone number and Bank verified and Card and Passport verified PayPal account. 100% No Limit.Buy Verified PayPal Accounts

    ReplyDelete

Your comments are valuable for us !!!