-3

I'm trying to create an extension for Chrome browser.

I want to make an alert box automatically appear when the browser opens for the first time using this extension (without clicking on the extension icon though).

First time mean normally when i open the chrome double clicking on the icon.

Which JavaScript code should I use?

DnwAlgorithma
  • 119
  • 1
  • 4
  • 16
  • That's not my cause Xan. i mean the first time is when i double clicking open the browser normally.not only the very first time after installing the chrome browser. – DnwAlgorithma May 15 '14 at 20:42
  • Then you can just put your code into the top scope of a background script. It will be loaded at the same time as the browser startup. – Xan May 15 '14 at 21:03
  • Sorry..how can i do it.what is the meaning of background script ? – DnwAlgorithma May 15 '14 at 21:21
  • 1
    [Overview in the docs](https://developer.chrome.com/extensions/overview) is a good place to start. – Xan May 15 '14 at 21:23

1 Answers1

1

If you've read google docs you should know about background script. It's declared in manifest like

"background": {
"scripts":["background.js"]
},

So in your background.js you should use only alert(something here)

desu
  • 455
  • 2
  • 18