سؤال

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?

هل كانت مفيدة؟

المحلول

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)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top