Tuesday 15 August 2023

CE#1. First Chrome Extension - Demo

 Hey we know Extensions add functionality for any browser. We did not know how to do this simple thing.


Let us dive!


Only two files are need for creating extension

1. manifest.json ( required this configuartion file)

2. helloworld.html (any html file)


Steps:

First creat a directory CEDEMO

create manifest.json with the following contents:

{
    "name": "RMC Demo 1",
    "version": "1.0.0",
    "description": "Hello world!",
    "manifest_version": 3,
    "author": "Chandrasekaran RM",
    "action":{
        "default_popup": "helloworld.html",
        "default_title": "Display Something"
    }
}


Next, create helloworld.html with the follwoing contents for demo.

<!DOCTYPE html>
<html>
<head>
    <title>Demo 1</title>
    <meta charset="utf-8">
</head>
<style>
    body {
       width: 400px;
       height: 200px;
       background-color: aquamarine;
   }
</style>
<body>
    <h1> Hello Chrome extension World!!!</h1>
</body>
</html>


Just one header with style of window 400 x 200 px in <style> tag

Now save all the above files.

Thats all folks. We are done. We can install this in our chrome browser and make it work.

Click three vertical dots in the browser right top.



Look for extensions 

Click Manage Extension to get the 

Please check the Devloper mode.

Click Load Pack Extension Button and selet the directory by browsing for just created directory CEDEMO.


It shows everything is done. Now we have to select extension and pin it and click in the browser or select from the screen similar to the below one.

You will see the window similar to the one below:



 

Great ! You have done it! It is super simple . Done! 
Like this you can try any functionality in the extension helloworld.html file. Happy Extensions!!!😊😊😊😊(●'◡'●)(●'◡'●)


 


















 















No comments:

Post a Comment

Making Prompts for Profile Web Site

  Prompt: Can you create prompt to craft better draft in a given topic. Response: Sure! Could you please specify the topic for which you...