okay I've got one more probably more
than that but at least one more thing to
show you about Chrome extensions I'm
gonna show you about overrides what is
it override so first of all if you use
the Chrome browser and you ever hit
command T or new tab you get this
default page which has a Google search
and like shows you some recent web pages
that you've been to this is something
you can override you can create your own
web page that appears for a new tab and
there are lots of examples of Chrome
extensions that you can get that show
you pretty nice things and daily
affirmations and stuff like that you can
also override the history page and well
something else where do you find out
information about this it's I'll include
a link to this in this video's
description this is the documentation
for override pages so you can override
the bookmark page the history page and
the new tab page I'm going to override
just the new tab page and the way that
we do this is by adding this code here
to the manifest.json so I'm gonna copy
this and I'm gonna go to the manifest
JSON for a new Chrome extension I'm
gonna get rid of the content script I
just copied one of my previous ones I
could get I don't need a content script
as part of this and actually it wouldn't
make sense to have a new tab override
that also had a Content script I don't
think so and I want to override new tab
and what I want to do is point to my
HTML page and I happen to have
associated with this project this is my
example number 6 a folder called sketch
and it this is a p5 sketch and as an
index on a HTML page so what I want to
say is sketch slash index at HTML I am
going to just say function setup create
canvas 200 200 you know background 0 and
I'm gonna say I'm gonna add something
here like h1 hears a kitten cuz people
make a new so I'm gonna add some stuff
to the HTML and to the JavaScript just
to see that this works now what I'm
going to do is go to my extensions page
I am going
load the extension I want to load my
example number six ah great I got an
error what is my error looks like I have
an extra comma here and it's telling me
that I don't have valid JSON so I should
be able to go back to my manifest.json
get rid of that comma hit save try to
then say a retry that worked and now I
should open a new page yep
so every time I open a new tab I get
that webpage so let's make it do
something a little more interesting
let's say let's let's actually not have
a canvas
you obviously have an animation just say
no canvas I'm gonna say R equals a
random number between 1 and 6 because I
actually want you know I'm going to say
between 0 & 1 2 3 4 5 0 & 5 I have what
I have is and then I'm gonna say a
create image kittens / r + dot jpg so
what you might notice is that I have a
folder called kittens with 5 images of
kittens all named 1 through 5 so I
probably should have started naming him
with 0 but I could just add 1 to it so I
want to create a Dom element which is a
kitten image and show it on the page so
I'm gonna do that and I'm going to and
we might have an issue I mean I'm just
waiting to see what happens I'm going to
reload the extension I'm gonna make a
new tab up whoa that is and it worked
well now here's the thing
I should probably size it and I'm just
gonna say image size window with window
height image top position 0 0 so I mean
this is some silly I should probably be
more thoughtful about CSS and all that
but I'm just going to use some p5 code
to size the image to the page and maybe
I'll get rid of the hears a kitten
message now I'm going to
reload again and now make a new tab or
every time I make a new tab I get a
different kitten
yay so this is how you do a override so
now the world is your kitten oyster
think of what you might make something
that checks the today's weather if you
want to make something practical
something that shows something beautiful
something that reminds you of an
important message anything that you can
think of you can make anything you can
make a webpage you can make as the new
tab override thanks for watching
subscribe like I'm supposed to say at
the end of the video this was a short
one so maybe you might actually hear me
[Music]
you