Is it possible to animate extension popup opening? - google-chrome-extension

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.

Related

Create a popup inside 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.

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.

Yahoo UI the popup implementation with YAHOO.widget.Dialog

I used the Yahoo.widget.dialog to implement a popup window. Currently, it popups only on the page which is belongs. If I am working on the other (tab browser) pages. The popup window will be not seen.Could somebody supply some help for this ?Thanks
You could either switch to window.alert() or use window.open() to open a new pop-up window containing your content.
Neither one is something I'd personally want to experience, but those are your two options for opening a pop-up outside the page. Window.open will get caught by many pop-up blockers so you'll need to watch for that.

Resources