How to show popup in Chrome extension?


username

I need to show a popup in a chrome extension. This popup will appear in a new window when the extension icon is clicked.

What I need is that when I click on the extension, I should see a popup below the extension icon. Like this http://developer.chrome.com/extensions/getstarted.html . associated). My popup (userinfo.html) asks for login with username and password. When the user enters username and password and logs in, the popup should close and when the user clicks the extension icon again, it should navigate to a website. How can I do this? Here is my background.js

chrome.browserAction.onClicked.addListener(function(tab) {
 if(!localStorage.username){
   chrome.browserAction.setPopup({
    popup: "userinfo.html"
   });
 }
 else
   //navigate to website
});

This way, I will show my popup. This popup appears when the user clicks the icon for the first time after installation. Otherwise it will navigate to a website. Now my problem is that when I click the icon only twice, the second problem is that after I enter my name and password and click login, the popup closes, which is fine. . when I click the icon again it should actually navigate to the site, but in my code it shows again that pop reloads the extension and it works fine. Why is this happening? Please help me. There is a file called userinfo.html that should appear as a popup. what should I do? Please help me.

Zambre

In browser actions, the default_popup value should be included, which points to the HTML file to be rendered as a popup. In your case it is userinfo.html.

"browser_action": 
     {
   "default_icon": "icon.png",
   "default_popup": "popup.html"
    }

More info here : http://developer.chrome.com/extensions/browserAction.html

Related


How to show popup in Chrome extension?

username I need to show a popup in a chrome extension. This popup will appear in a new window when the extension icon is clicked. What I need is that when I click on the extension, I should see a popup below the extension icon. Like this http://developer.chrom

How to show popup only once in chrome extension?

username Hi I need to show a popup in a chrome extension. I have my website set up as a Chrome extension. Here is the use case: When the user installs the extension and clicks the extension icon, it should display a popup asking for their username. When the us

How to show popup only once in chrome extension?

username Hi I need to show a popup in a chrome extension. I have my website set up as a Chrome extension. Here is the use case: When the user installs the extension and clicks the extension icon, it should display a popup asking for their username. When the us

Simple Chrome extension doesn't show popup

SO user I'm making a simple chrome extension that should show me the time in a popup. I'm learning from here and there using online resources. Here is my list: { "manifest_version": 2, "name": "Time Machine", "version": "1.0", "description": "Get the

Simple Chrome extension doesn't show popup

SO user I'm making a simple chrome extension that should show me the time in a popup. I'm learning from here and there using online resources. Here is my list: { "manifest_version": 2, "name": "Time Machine", "version": "1.0", "description": "Get the

How to call popup to show in Safari app extension?

innocent I am developing a safari app extension using swift in xcode. In mine SafariExtensionHandler.swift, I declare a func: override func popoverViewController() -> SFSafariExtensionViewController { return SafariExtensionViewController.shared

How to call popup to show in Safari app extension?

innocent I am developing a safari app extension using swift in xcode. In mine SafariExtensionHandler.swift, I declare a func: override func popoverViewController() -> SFSafariExtensionViewController { return SafariExtensionViewController.shared

How to call popup to show in Safari app extension?

innocent I am developing a safari app extension using swift in xcode. In mine SafariExtensionHandler.swift, I declare a func: override func popoverViewController() -> SFSafariExtensionViewController { return SafariExtensionViewController.shared

How to call popup to show in Safari app extension?

innocent I am developing a safari app extension using swift in xcode. In mine SafariExtensionHandler.swift, I declare a func: override func popoverViewController() -> SFSafariExtensionViewController { return SafariExtensionViewController.shared

How to call popup to show in Safari app extension?

innocent I am developing a safari app extension using swift in xcode. In mine SafariExtensionHandler.swift, I declare a func: override func popoverViewController() -> SFSafariExtensionViewController { return SafariExtensionViewController.shared

How to Shrink Chrome Extension's Popup Window

max clearer Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. Ther

How to Shrink Chrome Extension's Popup Window

max clearer Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. Ther

How to make Chrome extension popup draggable?

Chen ric I noticed that the 1password chrome extension browser action popup is draggable. How can I make my own chrome extension do the same thing? I can't seem to find anything in the chrome extension documentation. I haven't found some other features of the

How to Shrink Chrome Extension's Popup Window

max clearer Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. Ther

How to create a "tail" on a Chrome extension popup

Jack Durrell I want to create a tail on a chrome extension popup pointing to the extension icon like this: I tried looking at the documentation, including the source of the image above, but couldn't find anything. See this link for pictures: Extended docs show

How to Shrink Chrome Extension's Popup Window

max purifier Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. The

How to Shrink Chrome Extension's Popup Window

max clearer Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. Ther

How to make Chrome extension popup draggable?

Chen ric I noticed that the 1password chrome extension browser action popup is draggable. How can I make my own chrome extension do the same thing? I can't seem to find anything in the chrome extension documentation. I haven't found some other features of the

How to make Chrome extension popup draggable?

Chen ric I noticed that the 1password chrome extension browser action popup is draggable. How can I make my own chrome extension do the same thing? I can't seem to find anything in the chrome extension documentation. I haven't found some other features of the

How to Shrink Chrome Extension's Popup Window

max clearer Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. Ther

How to Shrink Chrome Extension's Popup Window

max clearer Some extensions have popups that don't fit well on the page. If you can shrink the popup, you can use it normally, but there is no obvious way to do this. Screenshot example: You'll see the popup extending below the visible part of the screen. Ther

How to make Chrome extension popup draggable?

Chen ric I noticed that the 1password chrome extension browser action popup is draggable. How can I make my own chrome extension do the same thing? I can't seem to find anything in the chrome extension documentation. I haven't found some other features of the

How to make Chrome extension popup draggable?

Chen ric I noticed that the 1password chrome extension browser action popup is draggable. How can I make my own chrome extension do the same thing? I can't seem to find anything in the chrome extension documentation. I haven't found some other features of the

How to create a "tail" on a Chrome extension popup

Jack Durrell I want to create a tail on a chrome extension popup pointing to the extension icon like this: I tried looking at the documentation, including the source of the image above, but couldn't find anything. See this link for pictures: Extended docs show

Responsive Chrome Extension Popup

Annon I'm developing a chrome extension and I got the design as a .psd. I have px values for all layers. The design was done on a 1225X2019 screen, resulting in oversized popups, fonts, margins, spacing, etc. on my smaller screen. In my css file I use the px v

Chrome Extension - Change Popup

Sean Morris I have a chrome extension that allows users to log into the system. I want the default page to appear when the extension is opened when the user is not logged in, but if they are already logged in I want another popup to appear when the extension i

Create a popup in a chrome extension

peterland I need to have a small div like a popup on my chrome extension. This div needs to have a simple animation and no menu bar at all. Is it possible to do this using the chrome.windows.create method? Is there another way? What I need is a pocket-like ext

chrome extension popup not showing

White Death I'm using the Chrome extension, but when the icon is clicked, the popup doesn't show. I've seen some questions saying the problem is related to page_actionbe browser_action, but when I do that, it doesn't work, still nothing is displayed. I'm using

Responsive Chrome Extension Popup

Annon I'm developing a chrome extension and I got the design as a .psd. I have px values for all layers. The design was done on a 1225X2019 screen, which resulted in oversized popups, fonts, margins, spacing, etc. on my smaller screen. In my css file I use the