Hacker News new | ask | show | jobs
by DonHopkins 3116 days ago
I really appreciate you writing up and sharing your migration story and raw opinions, as well as all the great code you've written. Thanks you!

I've done some xulrunner app development as well as IE ActiveX control browser extensions in the past, including various implementations of pie menus, and I would like to learn more about the latest Firefox, Chrome and Safari extensions APIs, so I can implement pie menus properly for those platforms.

That's why I'm so happy to be able to read your migration story and raw opinions! Reading about you experience is even more valuable than reading the source code itself! Thank you again! ;)

I've implemented pie menus in jQuery for web pages [1] [2], but they really need to be rendered with transparency in their own arbitrarily shaped popup overlay windows, so they're not confined to the browser window, like I was able to do with ActiveX controls in C++/MFC and also X11/TCL/Tk back in the 90's [3], and with NeWS in PostScript back in the 80's [4].

I noticed that Safari extensions have an API for creating popover windows called SafariExtensionPopover [5] [6] [7]. But they must be rectangular, and the documentation doesn't mention how their position is defined (but I presume they appear beneath the cursor or invoking toolbar item). So there doesn't seem to be an obvious way to position or shape them. (Could you get the popover's window, and set its position pixel-perfectly regardless of borders?)

As far as I can tell, Safari's popovers are only good for traditional linear menus that pop up below the cursor or toolbar item, because you can't even control their position to center them on the cursor like a pie menu requires.

Do you know if there any way to create a pop-up window in any position or size, and even to set the background color transparent, so I can make arbitrarily shaped and popup windows? Even rectangular overlapping popup windows would be better than having to clip them to the window frame.

Do you have any suggestions for how I should approach the problem, please? What kind of browser extension API do you think could be designed or modified to support arbitrarily shaped pop-up windows for pie menus and other techniques (like tabs sticking out the edge of the window [9], for example)?

(The X-Windows SHAPES extension [10] is a terrible example of the worst possible way of doing that! ;) )

[1] https://github.com/SimHacker/jquery-pie

[2] http://donhopkins.com/mediawiki/index.php/JQuery_Pie_Menus

[3] https://www.youtube.com/watch?v=nnC8x9x3Xag

[4] https://www.youtube.com/watch?v=tMcmQk-q0k4

[5] https://developer.apple.com/library/content/documentation/To...

[6] https://developer.apple.com/documentation/safariextensions/s...

[7] https://developer.apple.com/documentation/safariextensions/s...

[8] https://forums.developer.apple.com/thread/53646

[9] https://news.ycombinator.com/item?id=8042726

[10] https://hn.svelte.technology/item/15325226 (search for XShapeQueryExtents)

1 comments

You can use native messaging to send a message to a script or executable that crates that arbitrary and transparent window. Nothing inside webext allows you to do exactly what you are looking for though from inside the webext.