Тёмный

Build a Chrome Extension - Course for Beginners 

freeCodeCamp.org
Подписаться 10 млн
Просмотров 563 тыс.
50% 1

Learn how to create a Chrome browser extension using JavaScript and the new iteration of the web extensions platform, called Manifest V3.
✏️ Raman Hundal developed this tutorial.
💻 RU-vid Bookmarker Starter Code: github.com/raman-at-pieces/yo...
💻 RU-vid Bookmarker Finished Code: github.com/raman-at-pieces/yo...
🔗 Pieces Code Snippet Assistant download: pieces.app/install
🔗 Publishing extension on the chrome store docs: developer.chrome.com/docs/web...
⭐️ Course Contents ⭐️
⌨️ (0:00:00) Intro
⌨️ (0:02:15) Demo
⌨️ (0:05:18) Understanding manifest.json
⌨️ (0:08:46) Coding the extention
⌨️ (0:31:37) newVideoLoaded function
⌨️ (0:31:37) fetchBookmarks
⌨️ (0:37:08) addEventListener
⌨️ (0:48:03) addNewBookmark function
⌨️ (1:00:33) Testing the extention
🎉 Thanks to Pieces.app for providing a grant that made this course possible.
🎉 Thanks to our Champion and Sponsor supporters:
👾 Raymond Odero
👾 Agustín Kussrow
👾 aldo ferretti
👾 Otis Morgan
👾 DeezMaster
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Опубликовано:

 

2 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 378   
@joeychukc
@joeychukc 5 месяцев назад
Thank you for making this useful video, this is so far the most detailed and advanced tutorial I could find on RU-vid!
@quiyoma3730
@quiyoma3730 2 года назад
Time to save to the PlayList of videos I wanna watch but will never watch
@noface00
@noface00 2 года назад
way to go
@yochutes
@yochutes Год назад
😂
@maxfrischdev
@maxfrischdev Год назад
*cough cough* 😅🤣🤣🤣
@dimitrivasilev2905
@dimitrivasilev2905 Год назад
This one is only an hour long! I’m sure you can fit it in your schedule somewhere. I believe in you 💪
@boredomindex3353
@boredomindex3353 Год назад
😂
@pintaridergaming
@pintaridergaming 2 года назад
Ok this is crazy, i searched for this yesterday and now this came out
@sleeping_dragon
@sleeping_dragon 2 года назад
Definitely the best chrome extension tutorial I've seen so far. Others are either really outdated or don't teach much, or both. This is great.
@TypicallyThomas
@TypicallyThomas 2 года назад
If this is the best you've seen I worry about the others because this is quite poor
@bharathkumar5870
@bharathkumar5870 2 года назад
@@TypicallyThomas plz tell me other sources for learning chrome extensions plz
@TypicallyThomas
@TypicallyThomas 2 года назад
@@bharathkumar5870 Don't have any I'm afraid
@zoldlen883
@zoldlen883 2 года назад
@@TypicallyThomas You will need to go to school for it then. That's all the internet is. Follow alongs.
@dimitrivasilev2905
@dimitrivasilev2905 Год назад
@@zoldlen883 not sure how school is any better. School will introduce you to the concept of making a google chrome extension and then quiz you on it with the expectation that you’ve already mastered it.
@alexbright9849
@alexbright9849 2 года назад
This is what i did need yesterday and you posted this thanks❤️❤️❤️❤️❤️
@aakarsh1475
@aakarsh1475 Год назад
Wow, this video is really advanced! He goes through all the steps so fast and assumes you already know a lot of things. This is definitely not for beginners who want to learn how to make an extension from scratch. You need some prior experience and knowledge to follow along. I wouldn't recommend this video to anyone who is just starting out with extensions. It might be too confusing and frustrating for them.
@nathanfoss766
@nathanfoss766 Год назад
He did say at the beginning of the video that you need an understanding of JavaScript and DOM manipulation.
@coryanders6328
@coryanders6328 Год назад
@@nathanfoss766 having plenty of experience with both, there are still a lot of other assumptions made about what the viewer knows. there's not even really a starting off point. it's kind of like "you know algebra, right? here's calc II".
@zabity
@zabity 8 месяцев назад
@@nathanfoss766 and then he skips the fact of using an IFEE as if it's obvious, then suddenly background.js comes in dunno why and then he puts an even listener on a chrome object in pure js. whoa!
@yuvrajsingh-gm6zk
@yuvrajsingh-gm6zk 3 месяца назад
you gotta need to take the discomfort, learning isn't supposed to be fun, and whenever you find learning fun that is just because you have plenty of prior knowledge to begin with!
@harshjaiswal1634
@harshjaiswal1634 2 года назад
Exactly what I was looking for
@frodelius
@frodelius 2 года назад
@@anchyzas Well, does it work for you guys?
@eitan_schwartz
@eitan_schwartz 2 года назад
Waited for tutorial like this for long time
@dheerajrawat6201
@dheerajrawat6201 2 года назад
This is the thing i wanted from such a long time
@edgyman1956
@edgyman1956 2 года назад
I've been looking for this course for so long
@frodelius
@frodelius 2 года назад
Keep looking.
@md.jannatulnayem4328
@md.jannatulnayem4328 Год назад
Absolutely loved it. Bring us part 2 ✨
@chrisdesigns
@chrisdesigns 2 года назад
Freecode camp is incredible. One love❤️
@Neko-Pro-Watcher
@Neko-Pro-Watcher Год назад
Thank you. I learned a lot, this cover many things!
@crusader_
@crusader_ 2 года назад
Low-key wanted this. Love free code camp
@BehruzbekOtayev
@BehruzbekOtayev 2 года назад
What's low-key?
@who_s_afraid
@who_s_afraid 2 года назад
​@@BehruzbekOtayev it says it has meaning of restrained, like “of low or moderate intensity, not very forceful" or chilly.
@tunni8126
@tunni8126 Год назад
Two things I found useful while developing this extension: 1. choosing that video for test purposes which has no ads. Like those of sandeep maheshwari. 2. using 'extensions reloader' extension for one click reload of the upacked extensions. Make sure to pin this extension.
@AbuFaizal
@AbuFaizal 2 года назад
love it, thanks for making this video
@kgarun
@kgarun Год назад
Great tutorial. Thanks!
@DogeMultiverse
@DogeMultiverse 2 года назад
learning thru the chrome extension discord is amazing!
@anonfourtyfive
@anonfourtyfive Год назад
Wow, just found out this. What a precious thing, I'll try this out.
@Qpham90
@Qpham90 Год назад
never would i have thought a delicious japanese noodle dish would teach me how to make a chrome extension, how far we've advanced
@OriginalCodeMaster
@OriginalCodeMaster 2 года назад
Nice tutorial, I was looking for such a video for a while. Thanks for your content 😍🤩
@Loug522
@Loug522 2 года назад
I've been learning js and html these past few days, this one seem like a fun adventure for when I finish the Scrimba course.
@jackepner9984
@jackepner9984 2 года назад
Came here BECAUSE of the Scrimba course... Scrimba is far better for gaining understanding of what javascript does and how to use it. But when it comes to a project... I was pretty disappointed to see the chrome extension project be nothing but a bookmark extension, which of course exists natively in all browsers. Useless. I'd at least like to spend my hours committed to a course building something that isn't completely worthless.
@patrickctaylor
@patrickctaylor 2 года назад
Thanks for the tutorial!
@benvarkey5097
@benvarkey5097 2 года назад
Was waiting ❤️
@popov654
@popov654 11 месяцев назад
Thanks for easy and understandable tutorial, it's really good. Though I would say some things could be done better. 1. You should probably test on timestamp existance on bookmark creation to avoid creating duplicates when a user clicks the button several times in a row 2. You should probably deal with storage in background page/service worker, and not in content script. Even though the code in content script will become less beautiful, I guess it is better in terms of architecture. And if you don't care about architecture at all, why just not move that to popup.js? Your content script really does not need to get access to the full bookmarks list in order to add a "plus" button and assign a click handler to it. 3. Maybe you don't have to refetch all the bookmarks after deletion, just add some logic for handling an empty list case (some speed optimization). 4. Finally, Chrome definitely won't allow us to change the active tab leaving the popup opened (though Firefox really allows something like this using a special development option to preserve all opened popups), but we can overprotect ourselves and save the current page url or video id somewhere in popup.js, so that we can be 100% sure that we are deleting the right things. I know that it is a video for beginners, but still. Also it was worth mentioning about the total storage limitsof each type that Chrome allows us to store.
@universecode1101
@universecode1101 2 года назад
This is very cool, thanks guys 🤩
@pranich
@pranich Год назад
Best tutorial. Thank you!
@tazimmahta7625
@tazimmahta7625 2 года назад
Yoo ! what a timing ❤❤❤
@aM_Tovi
@aM_Tovi 6 месяцев назад
Thank you for this tutorial now i am going to make one extension for myself 😊
@Arunnn241
@Arunnn241 Год назад
Good video. By no means best video I've seen. It's clear there's a script or some background code that's being read from bc the order of operations from "what do I need to do" to "code I wrote" are out of order. You go through the instruction as if you're working from the solution rather than the problem and that eliminates the problem-solving process: questions like "why do I want left controls and not right controls?", "why this video player?", "why a value property?", "why are splitting this up into so many different functions from the start?" are prominent in a viewers' mind throughout the video which causes mental fatigue.
@edgargreene2628
@edgargreene2628 2 года назад
thx for this amazing tutorials
@kendralewis5883
@kendralewis5883 28 дней назад
Must come back to this playlist 👀
@Gamla123
@Gamla123 3 дня назад
Fantastic video. thank you
@gdp60b40
@gdp60b40 2 года назад
This is just amazing
@frodelius
@frodelius 2 года назад
Was it too good to be true after all?
@ugur76
@ugur76 Год назад
This finished code itself in git repo is not working currently in chrome
@suniljadaun5814
@suniljadaun5814 2 года назад
Arrre bhartiya ... feel proud
@graemeStanley
@graemeStanley Год назад
Great tutorial. Thanks for all your hard work putting this together.
@VitorHugo-np9qs
@VitorHugo-np9qs Год назад
Hey man, what's up? Can you put the extension created on video works?
@mrrishiraj88
@mrrishiraj88 2 года назад
Thanks a million
@HavoJavo
@HavoJavo 2 года назад
I love you guys
@viraatkumar8980
@viraatkumar8980 Год назад
anyone getting a failed to load resource error on the comleted version of the code from his github? says access it blocked by client or something
@alexandr8151
@alexandr8151 Год назад
Awesome!!
@vmendes9999
@vmendes9999 2 года назад
Funtastic! Tank you Raman for this sharing I've created my first Chrome extension :-)
@cabiste
@cabiste 11 месяцев назад
a better start to the video after the demo would've been to show us how to create the boilerplate code as that will let us understand how the extension works better
@adityasaurabhsingh6528
@adityasaurabhsingh6528 7 месяцев назад
use user snippet under the settings gear and there you can write your code ,change the name to boilerplate
@IndieLifeAlexAdamov
@IndieLifeAlexAdamov 2 года назад
Nice Tutorial. Made me realize I needed to brush up on Dom manipulation. Don
@abdul_qadir7780
@abdul_qadir7780 2 года назад
Woow i love the content. 😍
@ragtop63
@ragtop63 Год назад
I'd really like to see a thorough tutorial on how to build a browser extension using a framework, like Vue. Finding any information on how to do it seems to be one of the most difficult things to find on RU-vid right now.
@user-un9ne9zw7d
@user-un9ne9zw7d Год назад
rightt? there are so many videos that talk about manifest version 2 but none on mv3
@popov654
@popov654 11 месяцев назад
@@user-un9ne9zw7d why the hell do I need MV3? I am more than happy with Manifest V2, service worker/content script/background page script are basically just all the same thing IMO.
@firewatermoonsun
@firewatermoonsun Год назад
Many thanks!))
@sllakshancc
@sllakshancc Год назад
Thank You 💗💓
@jaiganesh12
@jaiganesh12 Год назад
Hey, great tutorial to get started with manifestv3 and chrome api.. You've got everything covered
@programmingtravelandsuccess
at around 16:00 im getting an error because function newVideoLoaded() does not exist...i check the code and im still wondering. Why are you calling newVideoLoaded() when it is nowhere defined?
@sesencat
@sesencat Год назад
This inspire me to give up on coding
@sanjaykanade966
@sanjaykanade966 3 месяца назад
After much research, selected this as my first tutorial on Chrome Extension Development. Turned out great! The only problem I faced initially was the error "Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist." Was not easy to find a solution. Finally, what worked is open a new Chrome window after reloading the extension. None of the solutions on Stack Overflow mentioned that. Another thing that should be made clearer in the video is how do you bring up the Console for the Background service worker. The video is too quick and it is difficult to see this part. Finally, turned out, you can do that from the Manage Extension itself. To see log of the Content script, use the regular browser Developer Tools.
@littlehearts7039
@littlehearts7039 Год назад
Thanks Ramen
@mdhossen7082
@mdhossen7082 2 года назад
Wow,, this video is Very helpful,
@gusr7513
@gusr7513 2 года назад
Hey everyone. If you add newVideoLoaded(); at the end of contentScript as the purposed quick fix, the extension won't work properly on reload. The reason is that you will not get the video ID into the currentVideo variable, so you won't be able to add new timestamps. The best quick fix I came up with was to force a new URL (I also studied how RU-vid deals with different URLs) and I came up with this code that you can add to your contentScript in the place of newVideoLoaded() (the one at the end, line 64 of the finished code); let trail="&ytExt=ON"; if(!window.location.href.includes(trail)&&!window.location.href.includes("ab_channel")){ window.location.href+=trail; } This should force an update on the URL of the RU-vid when necessary, which will then trigger the chrome.tabs.onUpdated. I hope this helps. (For those who want to know what is ab_channel, it is something youtube adds spontaneously for some videos (with channel info) and that triggers the chrome.tabs.onUpdated on its own.) Cheers! EDIT!! Also include a condition &&window.location.href.includes("youtube.com/watch") in the if statement i gave. You don't want it to update the URL in non-RU-vid websites.
@ayomideoguntuase165
@ayomideoguntuase165 2 года назад
Admin should definitely pin this comment or help fix the github repo cos it fixed a major issue that renders the extension useless.
@IonutSultana
@IonutSultana Год назад
Thanks for helping us out. I was debugging this due to an "Extension context invalidated". That was generated because when calling the newVideoLoad() the fetchBookmarks function didn't have with what videoId to work with.
@Praveenkumar-gv2qu
@Praveenkumar-gv2qu 2 года назад
Awesome ❤️
@shreedharpandey3319
@shreedharpandey3319 2 года назад
This is gonna make me some good money.
@kintag4459
@kintag4459 2 года назад
Thank you M.r
@RAVINDRAKUMAR-gj2nx
@RAVINDRAKUMAR-gj2nx Год назад
I am a beginner and just searched video on youtube to learn how extensions work and my doubt is cleared now. thank you a lot.
@preadsy6912
@preadsy6912 2 года назад
Very interesting!! This course is really exciting and modernistic
@syntheticperson
@syntheticperson Год назад
Extremely enlightening. Many thanks! 🙏🏽
@eab4984
@eab4984 Год назад
In my addNewBookmarkEventHandler the line currentVideoBookmarks = await fetchBookmarks(); throws an error with the message: Uncaught TypeError: Cannot read properties of undefined (reading 'sync') at :3:26 at new Promise () at fetchBookmarks (:2:16) at :1:31 What could that be?
@MadaniChannel_QuranUrdu
@MadaniChannel_QuranUrdu 2 года назад
Masha'Allah 🌹
@josemontalvo5052
@josemontalvo5052 2 года назад
How would you go about doing the following: When you click on the icon to bookmark, the extension popup opens automatically? no need for you to go all the way to the icon and click it?
@shruthimohan8438
@shruthimohan8438 Год назад
hi....did you get solution to this prb?
@amirhassan6549
@amirhassan6549 2 года назад
Good tutorial
@frodelius
@frodelius 2 года назад
Yes it is, just a pity the extension doesn't work for me. Does it work for you?
@StampsbyK
@StampsbyK Год назад
nice video
@mbdAli
@mbdAli 2 года назад
this one saved me ton of time. how to get pagesource of new window opened?
@ascourter
@ascourter Год назад
This is great. Thanks for sharing this. Is it best practice to aim for high compatibility when building extensions or do people include polyfills or other libraries like jquery when writing extensions?
@mikevaleriano9557
@mikevaleriano9557 Год назад
It's 2022, no one should be using jQuery for anything anymore.
@popov654
@popov654 11 месяцев назад
@@mikevaleriano9557 Why? jQuery is a good library in terms of wyntax, speed and compatibility.
@cu0ngpitt
@cu0ngpitt 2 года назад
why do you write the content script in a immediately invoked function?
@joeylucas7185
@joeylucas7185 2 года назад
Something I've wanted to do
@briannaharris731
@briannaharris731 Год назад
What VScode extension are you using to provide autocomplete suggestions regarding the Chrome APIs as you code. Particularly in your background.js file?
@briannaharris731
@briannaharris731 Год назад
New to chrome development and any help would be much appreciated!
@terfel9476
@terfel9476 Месяц назад
Did you ever find out? I'd really like to know!
@UrzaRage778
@UrzaRage778 5 месяцев назад
Great video! How would you do something like grab all of the URLs from the tabs in the active window, and paste them to your clipboard with " " in-between each URL?
@arunprashanth369
@arunprashanth369 Год назад
what chrome extension i want to create a extension through which i can place buy sell orders while i am doing analysis in the tradingview charting website with a 3 sec timer to cancel (optional) and also info about the position i have taken, without switchin logging moving too much . well need to figure it out how to do it just started the course so hopefully built it in 30 days
@debillion
@debillion 2 года назад
Can you please, give me an understanding of how to automate the submission of this extension to webstore?
@BrandonCMaximum
@BrandonCMaximum 7 месяцев назад
I'm not sure if something has changed about Chrome extensions since this tutorial was made, but this doesn't seem to work anymore. Even the finished project in the git repo. After making my own changes to grab the URL on the content script/popup JS files directly instead of messing with utils and background, I finally got it working.
@dohverse1407
@dohverse1407 5 месяцев назад
Yes, it does not seem to be working for me either. Would you mind telling me what changes you made? Ive been having trouble fixing the problem. Thanks
@changxinzhang
@changxinzhang Год назад
why I can only see the console.log of contentScript using Inspect? I cannot see the console.log of background.js
@SecurityTalent
@SecurityTalent 2 года назад
Great
@fareedezzedeen8017
@fareedezzedeen8017 Год назад
I was looking for this for a long time, All contents talks about v2
@AbhijeetBGavali
@AbhijeetBGavali 2 года назад
use this to list your idea for the new extension, let's see who comes up with the best idea!
@pastuh
@pastuh 2 года назад
Extensions helps when company programmers can't fast provide specific functions.
@JoaquinPeMM
@JoaquinPeMM 3 месяца назад
Would anyone mind to explain me the syntax on the "chrome.storage.sync.get([currentVideo], (obj) => {..." inside the fetchBookmarks function? is [currentVideo] the name of the key?
@chrisklupenger4999
@chrisklupenger4999 Год назад
what text editor is he using for the coding?
@ericstudiox7226
@ericstudiox7226 Год назад
this is a beginners question im sure but when i click on loadunpack, it doesn't see any of my files which i created in dreamweaver..ie js,json,css,html , nothing...help please
@yannickcotten2854
@yannickcotten2854 Месяц назад
Hi and thanks for that tutorial, it's very interesting and instructive. However there's one thing that let's me a little perplexed : if I understand it right, the sole purpose of your background script is to uselessly transmit in a complicated way the tab's page url to the content script ??? because so far I can achieve this with the classical and much more simple document.URL property directly inside the content script.
@sunnyy6295
@sunnyy6295 9 месяцев назад
will it work in safari browser as well?
@user-ig2kn5xd9m
@user-ig2kn5xd9m 6 месяцев назад
I want to build an extension like autods. How would I go about in doing that ? It's a product importing tool.
@omarruder4129
@omarruder4129 9 месяцев назад
why is the code in contentscript.js enclosed by parenthesis, and called upon directly?
@listerofsmeg
@listerofsmeg Год назад
It's broken background.js:1 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
@sounakroy9284
@sounakroy9284 Год назад
yes
@Lunolux
@Lunolux 2 года назад
nice
@m-108
@m-108 Год назад
i want to make a chrome extension in which i can freely zoom in x-axis or y-axis of a website independently or individually. specifically, i am currently unsatisfied with the UI of g-calendar and thus want to vertically zoom in on the page without horizontally zooming in. i hope such type of chrome extension can be made, isn't it?
@05060024
@05060024 2 года назад
Why did "async" suddenly appear on line 14 at 24:34? There's no explanation of that.
@nocopyrightgameplaystockvi231
@nocopyrightgameplaystockvi231 2 года назад
I am going to develop a pdf maker for the code in the webIDE.
@dota2content755
@dota2content755 Год назад
Helllo Im facing an error, when I send a message from background script I encounter this error, help me please I can't get rid of it....! Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
@plainzone8356
@plainzone8356 9 месяцев назад
same here
@atomik-code
@atomik-code 8 месяцев назад
Same here also, do you guys find any solutiion to this? @@plainzone8356
@miraclemark6120
@miraclemark6120 5 месяцев назад
Me 3
@shanli9593
@shanli9593 Год назад
how to debug during development if things don't work out as expected?
@intrigdcafeecunicamp288
@intrigdcafeecunicamp288 2 года назад
Where we need to upload this code to appear in Chrome
@themarsalien
@themarsalien Год назад
5:20 I might have skipped a step but what menu is this?
@juggla4evr1
@juggla4evr1 Год назад
How can I have someone build Me an extension & at the same time a website, would they be two different things or can You do them at the same time? What's the recommended method?
@seminireadebiyi6612
@seminireadebiyi6612 10 месяцев назад
Pls where can i get the boiilerplate so i can copy and paste the code
@XXBrunX
@XXBrunX Год назад
25:20 does not work, event is still not fired on page refresh
@shivkini9119
@shivkini9119 Год назад
When I use it on videos which are segmented, the button becomes very narrow. How to avoid this?
Далее
I Tried Every AI Coding Assistant
24:50
Просмотров 751 тыс.
100+ Linux Things you Need to Know
12:23
Просмотров 917 тыс.