Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a "Help" page after Chrome extension is installed first time

I am new to Chrome extension. I have a question about how to make the extension to open a "Help" page automatically after installation. Currently, I am able to check whether the extension is running the first time or not by saving a value into localStorage. But this checking is only carried out when using click the icon on the tool bar. Just wondering if there is a way that likes FF extension which uses the javascript in to open a help page after the installation. Thanks.

Edit: Thanks for the answer from davgothic. I have solved this problem. I have another question about the popup. My extension checks the url of current tab,

 if OK(url){     //open a tab and do something } else{     //display popup } 
Is it possible to show the popup in this way?
like image 896
user200340 Avatar asked Apr 21 '11 14:04

user200340


People also ask

Do I need to restart Chrome after adding extension?

How apps and extensions work. Apps and extensions work like regular programs for desktop computers, but they run entirely in the Chrome browser. You don't need to install software or restart your computer.

Do Chrome extensions work automatically?

When you turn on Google Chrome browser sync, then all your chrome extensions will be automatically installed on all your devices. Also, the settings and state for all these extensions will be the same on all your devices.

Why is Chrome not allowing me to enable an extension?

If you see a message saying "Extensions Disabled," it's because Chrome has turned off one or more of your extensions to keep your data safe while you're browsing the Internet. The extensions that Chrome turned off either didn't come from the Chrome Web Store or were determined unsafe.


1 Answers

Check this updated and most reliable solution provided by Chrome: chrome.runtime Event

chrome.runtime.onInstalled.addListener(function (object) {     let externalUrl = "http://yoursite.com/";     let internalUrl = chrome.runtime.getURL("views/onboarding.html");      if (object.reason === chrome.runtime.OnInstalledReason.INSTALL) {         chrome.tabs.create({ url: externalUrl }, function (tab) {             console.log("New tab launched with http://yoursite.com/");         });     } }); 

Add this to your background.js I mean the the page you defined on manifest like following,

.... "background": {       "scripts": ["background.js"],       "persistent": false   } ... 
like image 183
Nuhil Mehdy Avatar answered Oct 01 '22 13:10

Nuhil Mehdy