Create a popup inside chrome extension - google-chrome-extension

I need to have a small div like a popup
on my chrome extension.
This div needs to have a simple animation and not to have menu bar at all.
Is it possible to do it with chrome.windows.create
Method ? Is there another way to do it ?
What I need is similar to pocket's extension popup.
https://chrome.google.com/webstore/detail/save-to-pocket/niloccemoadcdkdjlinkgdfekeahmflj?hl=en

You need to use content scripts. If you have made a trigger the content script is able to change the page. By using that to your advantage you can add a div filled with all of the html you want to add. You can find a in depth example here.

Related

Is it possible to animate extension popup opening?

I developed a simple chrome extension. Following the answers in this SO post I was able to programmatically open the popup window on certain webpages. The default behavior of the popup is to open a window at the top right. Is it possible to modify this behavior? Ideally, I would like the popup window to slide in from the right after the automatic window.open is invoked in the background script.
No, you have no control over how and where it appears.
If you want something like slide-in, you're better off injecting your GUI elements into the page itself.
How feasible it is depends on whether you need to inject it into an arbitrary page or if you're working with just one specific website. Shadow DOM might help you isolate styles from the parent page.

Chrome extension Modal/Popup on click

I want to dynamically generate some buttons on my chrome extension default_popup HTML page and I want on click to open a model in the middle of the screen NOT a new tab, I saw some other extensions having its options like this, and then display some info.
I think the only possibility isto get rid of the defalt_popup and inject all my scripts through the background page straight into the html page.

Google Chrome Extension Development

I am developing a chrome extension that would like to add a tab at the bottom of the page to manipulate DOM elements. Chrome 'manifest.json' file doesn't provide such feature. So how to do it or rather how does Firebug add a tab at the bottom of the Chrome?
I would suggest inserting a panel in every page through a content script. You can style it in order to appear at the bottom of the page and be always visible.
In order for it to retain its state between navigation from one page to another, you need to persist it some how (example use chrome.storage or a similar mechanism through the background page to persist the content (or whatever you need).
See this answer on how to insert (and style) a toolbar-like div or iframe in a page through a content script. (It is fixed to the top of the page, but you can easily modify the code to fix its position at the bottom.)

How to open the default popup from context menu in a chrome extension

I have developed a chrome extension that opens a popup when I click on the icon near the address bar. Everything works fine, however I want to add some functionality to it. So I thought I'd also add a context menu item so that the user can simply search for the highlighted word. I want the popup to showup when the user clicks on the item in the context menu(the default popup in the top right corner and not a new popup window or a new tab).
Can I have this functionality? If yes, how do I implement it?
You can't make the popup page show programmatically as if the user clicked it.
However, you can still have something display based on the background script / content menu click. There are 4 main options for your background script:
Open a new tab to the popup.html page
Programmatic injection of javascript to construct a popup-like dialog on the page
Content script message passing to do the same as above, using a running content-script.
Use the notifications API for a simple minimally stylized message to the user.
Options 2, 3, 4 will allow the user to stay on their tab without any navigation. The notifications API route is the simplest to use if you just want some quick notification to the user, and there are fewer security snags. 2 and 3 require more book-keeping, but you can make the dialog look like your popup.
There should be an API for it now (as in 2023)
https://developer.chrome.com/docs/extensions/reference/action/#method-openPopup
update: tried, but failed, there was a bug.
https://github.com/GoogleChrome/developer.chrome.com/issues/2602
hope they fix it soon.
I was looking for extensions that I have already been used, but forget its name. This extension opened up the result into Context Menu, without open new TAB or popup.
may be useful
https://developer.chrome.com/extensions/contextMenus

Anyway to override/manipulate the Bookmark Page Action dialog box?

I am working on an extension that involves interacting with Chrome's bookmarks.
Is there anyway to either override the current Page Action dialog box for Bookmarks when you click on the star or is there anyway to change listing for the drop down of possible folders?
Barring that, is there a way to remove the star from the omnibar so that I can replace it with my own icon from my the extension?
No to all questions unfortunately.
The best your going to get is to add your own page action next to the default.

Resources