2

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 docs.

A few other features the 1password chrome extension popup has that I also can't find in the docs.

  • When the 1password popup appears, there's a little triangle at the top of the popup which appears where my cursor is. How does this happen? As far as I'm aware, then html document I associate with the popup is displayed as a rectangle without the triangle.
  • I can't right-click on the body of the 1password popup to inspect javascript. Could this be because they overrode the default contextMenu behavior?
Eric Chen
  • 45
  • 2
  • 6

1 Answers1

4

The standard popup window cannot be dragged, neither you can add anything outside of its borders. It's a popup page declared via browser_action or page_action in manifest.json.

The workarounds are:

To inspect pages that block the context menu you can open devtools from the browser menu, then "More tools", or focus the address bar first, then press the hotkey to open devtools (CtrlShifti or F12 in Windows) or from the internal UI page chrome://inspect/#pages.

P.S. technically you can write an external utility and run it via nativeMessaging so it'll use a low-level OS API to move the standard popup window, but that's very fragile.

wOxxOm
  • 65,848
  • 11
  • 132
  • 136
  • Thanks for the answer! I don't want to use chrome.windows.create, because the window doesn't auto-close when it's unfocused and it also has the topbar with the close/minimize/maximize buttons. But 1password's popup does this somehow. Making it a DOM element doesn't seem to be what 1password is doing here either, because you can drag the popup to outside of the border of the webpage. Given what you said, I don't think 1password is using the standard popup window at all, since the triangle is outside of the popup's borders. In that case, do you know what 1password could be doing? – Eric Chen Oct 12 '19 at 12:53
  • They can be simply showing their desktop app over the browser window. – wOxxOm Oct 12 '19 at 13:00
  • When the 1password popup shows up, I still see Chrome as the focused application on my macbook. Is that possible to do with a desktop app? – Eric Chen Oct 12 '19 at 13:10
  • A desktop app can do anything usually. See if you can find a window inspector utility similar to SPYXX in Windows. – wOxxOm Oct 12 '19 at 14:43