Developing Extensions for Google Chrome

Developing Extensions for Google Chrome 10: Final optimized code

11 videos

88 minutes

Finally to the extent they have had to make some adjustments behind the scenes, so in this video you will see a bit the final code. If you have been writing and at the same time were following the course to yourself practice developing the extension, maybe you go see what there It is different from what you have. Well in this video will show you the final code and explanations of what has gone

doing behind the scenes. Ok, and now with that if the extension is ready for publication in the play Store. With setinJs code you could put another channel and would be stored properly. As you can see, it works well. So now I'm putting my channel The only thing left now is to make notify us when the channel has uploaded a new video then for that, how could we do it?

Okay, we getVideoName, then, here could do one thing and serious this. We recall that the localStorage, local storage is where we can store information, okay, point, let's put lastVideo and you'll put equals videoName. Well, then, if you do, it and here I found a code of how to make a notification,

Okay, let's add this. First of all this code let's put it here. Okay, and this basically It is because if we do not have permits for notifications, bone, if we have guaranteed then, to make a request so that the user can access notifications. Well, maybe I'll do so. Well, no. Okay so. Then we do this, and so on.

Okay, let's indenting everything right, okay, so now. We have a little problem, it is worth, it would be my right if, to see! Well, now we have to make the code to get the thumbnail, but good, then this is already assumed. as bodi we'll put videoName, okay! And here we make a window, open point of the video link or not. we will do better

let's do this, let's do something, let's do that if you click in the notification do the same as the getVIDEO jot that. If you open a tab click popup. Voucher! popup, background and then we put embedlink. Voucher! Well here we are back eeh! I've already found. What had happened was that I did not remember that the Background folder had already ended.

And this was one that I started to write for a tutorial. Here and I have the final Background, you see, it is much more elaborate, for example: Has to put the name of youtuber, you have to get the video icon, which by the way, I use another object, since I was mistaken before, when it was looking to do, he was taking the object that was not right but, well. And as you see, because

Well, here we have to catch the youtuber name, icon, link and the name of the video. So what is the difference? What do we do? If there is no localStoreage.lastVideo, the localStoreage.lastVideo be equal to video video name, if not if the videoName is different localStoreage.lastVideo, we notify, that this is a feature we have done to notify.

And in the localStoreage.lastVideo, save the video name. Voucher! Now let's prove that this works. You'll see that going well. Okay, the truth is that this takes a long time to make, so, I have not written live, I pull, do not know if I remember exactly, I believe, as two hours if to do everything right, because I had never patched a website or anything and take a long time to find out

I could do this, with the indices and all. But OK. Now you see, I'm going to save this, and fence! For some reason… Well, as you see puts jjvm has a new video to open and the name of the video, click to open, and the name of the video, okay! - What I see is that not right the issue of link. VideoIconLink is called. Let's see what happened, of course, is that this ...

And if we open it says. You can not access. Thank you very much sir youtube! Well, and if we open it, it is telling us? you can not access. Okay, thank you very much sir youtube. Let's see! Well, for some reason do not work the images, but this script when I tried if it worked perfectly, then, I imagine, who have just made a change on the web,

because the bad of this is to bear in mind that any changes they make in the source code it will affect us, and we will have to re-adapt our code to yours. Then, in another video I will try to fix the image, Well, you see, any channel, Hola soy German for example, inadvertently I put it in another video. Wepa! Voucher!

We put here, and obviously save a few seconds, it comes to us, Hello I'm Germán has a new video, click to open. We open and here we have it, the video 'Hello I'm German'. Very good. Okay, now, to show you that this works well, Voucher! I'll put my channel. and then if I not mistaken, if for example, in my channel's see, 'pa pa pa' Okay, the truth is that video manager,

theoretically, this video, if I put it in secret, because the truth right now is not as done, okay. Hidden Let's see, well, who cares, I'll do it hidden. If and as theoretically when the video is hidden and no longer see ,. I should go now my new video is this. Because, of course! What actually does is only the latest video search

and then, if this is not bad, to see! Let's try something. This, see, then, for no charge? Let's put this.- I like to have logged in, is entering exactly the theme of xml http request, not if the session, bone, so clear is whether, I mean to see if the page Youtube has saved a session, with my stocken login, as though you log

that is, to see, wait a moment, the public. Yes. See, better go up something, anything, the first thing piye, and as that. Basically, look at this, for this very reason, why not. We will upload it just for show. See, explain to me, I think by making the xml http request, you are charging the web, just as if I charge browser

So if I sign and not Sierro, such as my own, and I from my account if I can see hidden video The xml http request, also is seeing. Then I'll do the test. Theoretically, this my channel, and now to see how long it takes to be published that's the problem. But I give to publish, to see what happens. In my channel, I do not know if it comes, no! No sale. Clear is that now,

This sucks! Because, see, I'll get any, now I have no video to go up and show you that it works. But simply by logic, well then, I'll cut and when it is turned up, I hope to see if it comes out the notification. Voucher! As you can see, I have not touched anything, and let the video was uploaded and as has been uploaded, you see instantly

almost before you leave here even we have to go to see him, okay! Well, it shows that the extension works well. Well, that's all for today. See you soon.

To find new courses, subscribe. There will be no spam, promised :)

About the Author

foto de jotajotavm
José Javier Villena

Biography: Analyst-Programmer in different languages. Tutor PREMIUM platforms recognized worldwide as CodigoFacilito. Editor Cristalab articles. My YouTube Channel is sponsored by the ANAYA and LaTostadora publisher. I like to explain in detail and give several examples for the avoidance of doubt.