Let It Run!

If your extension has successfully reloaded, you can make one last change to kittenbook.js to make the greeting look a little nicer (see Listing 1.12).

Listing 1.12 Updated kittenbook.js for Use in the Chrome Extension

var userName = prompt('Hello, what\'s your name?');document.body.innerHTML = '<h1>Hello, ' + userName + '!</h1>';

Adding the <h1> tag styles the greeting as a heading (big and bold text). Now reload the extension and open Facebook to see what happens. You should see your prompt window open and then see something similar to Figure 1.11.

Image

Figure 1.11 Hello, Facebook!

That was amazing—you ...

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.